Myasuka commented on a change in pull request #18391:
URL: https://github.com/apache/flink/pull/18391#discussion_r803640099



##########
File path: 
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/metadata/MetadataV2V3SerializerBase.java
##########
@@ -298,19 +306,24 @@ void serializeKeyedStateHandle(KeyedStateHandle 
stateHandle, DataOutputStream do
             if (stateHandle instanceof KeyGroupsSavepointStateHandle) {
                 dos.writeByte(SAVEPOINT_KEY_GROUPS_HANDLE);
             } else {
-                dos.writeByte(KEY_GROUPS_HANDLE);
+                dos.writeByte(KEY_GROUPS_HANDLE_V2);
             }
             
dos.writeInt(keyGroupsStateHandle.getKeyGroupRange().getStartKeyGroup());
             
dos.writeInt(keyGroupsStateHandle.getKeyGroupRange().getNumberOfKeyGroups());
             for (int keyGroup : keyGroupsStateHandle.getKeyGroupRange()) {
                 
dos.writeLong(keyGroupsStateHandle.getOffsetForKeyGroup(keyGroup));
             }
             
serializeStreamStateHandle(keyGroupsStateHandle.getDelegateStateHandle(), dos);
+
+            // savepoint state handle would not need to persist state handle 
id out.
+            if (!(stateHandle instanceof KeyGroupsSavepointStateHandle)) {
+                dos.writeUTF(stateHandle.getStateHandleId().toString());
+            }

Review comment:
       I don't have clear idea how incremental savepoint could work with 
change-log state backend yet. If the savepoint part would not contain any 
change-logs part, the `KeyGroupsSavepointStateHandle` should not be part of 
materialized states. If so, just as the doc in 
`KeyedStateHandle#getStateHandleId`said: 
   > If this state handle would be used as materialized part of 
{@linkChangelogStateBackendHandle}, it should persist this state handle id when 
serializing of checkpoint and deserialize it back to ensure the state handle id 
is constant.
   
   We don't need to persist the state handle id. Am I missing something here?
   
   




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscr...@flink.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org


Reply via email to