You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2022/01/18 16:37:25 UTC

[GitHub] [flink] rkhachatryan commented on a change in pull request #18387: [FLINK-25494][state] Duplicate element serializer during operator state sync snapshot phase

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



##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/state/PartitionableListState.java
##########
@@ -45,23 +47,25 @@
     private final ArrayListSerializer<S> internalListCopySerializer;
 
     PartitionableListState(RegisteredOperatorStateBackendMetaInfo<S> stateMetaInfo) {
-        this(stateMetaInfo, new ArrayList<S>());
+        this(stateMetaInfo, new ArrayList<>(), stateMetaInfo.getPartitionStateSerializer());
+    }
+
+    // constructor for deep copy.
+    private PartitionableListState(PartitionableListState<S> toCopy) {
+        this(
+                toCopy.stateMetaInfo.deepCopy(),
+                toCopy.internalListCopySerializer.copy(toCopy.internalList),
+                toCopy.stateMetaInfo.getPartitionStateSerializer().duplicate());

Review comment:
       Looking at the `stateMetaInfo.deepCopy`, I see that `RegisteredOperatorStateBackendMetaInfo` already deep-copies the serializer. And then this copy is used in constructor currently in `master`.
   
   The added test passes with the current (`master`) production code.
   
   So it seems to me the change is not necessary.




-- 
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-unsubscribe@flink.apache.org

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