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



##########
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 also don't have a clear idea of how it can be used - and that's 
exactly why it seems better to not make this case exceptional. 
   In the worst case, this ID will be read/written unnecessarily, which I think 
shouldn't be an issue for savepoints.
   As for the javadoc, I think it's easier to miss this clause.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to