[
https://issues.apache.org/jira/browse/FLINK-37524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937852#comment-17937852
]
Yue Ma commented on FLINK-37524:
--------------------------------
[~Yanfei Lei] Thanks very much for your reply.
Yes, as you mentioned , ForStKeyedStateBackend implement
`tryRegisterKvStateInformation` and will updateRestoredStateMetaInfo if
restored from checkpoint.
But the main problem is that the `StateSerializer` information in `newMetaInfo`
is not used in the constructor of `AbstractKeyedState`. Instead, it directly
used the information in StateDescriptor as the `StateSerializer`.
[https://github.com/apache/flink/blob/c151909d5a0d3568178c1a984da76b39d7e94dee/flink-runtime/src/main/java/org/apache/flink/runtime/state/v2/AbstractKeyedState.java#L57
.
|https://github.com/apache/flink/blob/c151909d5a0d3568178c1a984da76b39d7e94dee/flink-runtime/src/main/java/org/apache/flink/runtime/state/v2/AbstractKeyedState.java#L57]Therefore,
the old State Serializer in Checkpoint is not actually used.
I'm not sure if I expressed myself clearly.
> State Serializer in ForState should restore from oldStateInfo in Checkpoint
> ---------------------------------------------------------------------------
>
> Key: FLINK-37524
> URL: https://issues.apache.org/jira/browse/FLINK-37524
> Project: Flink
> Issue Type: Bug
> Components: Runtime / State Backends
> Affects Versions: 2.0.0
> Reporter: Yue Ma
> Priority: Major
> Fix For: 2.1.0
>
>
> Currently, when creating using ForStKeyedStateBackend create a new State ,
> *_AbstractKeyedState_* will directly use the serializer in
> _*StateDescriptor*_ regardless of whether it is restored from a Checkpoint.
> However, this may cause data to be unable to be restored when the last
> serializer changes (for example, the class registration order in
> *_KryoSerializer_* has changed, for specific cases, please refer to
> {*}_StateBackendTestBase#testKryoRestoreResilienceWithDifferentRegistrationOrder_{*}).
> Therefore, when creating a State from a Checkpoint, oldStateInfo should be
> used as the new State's Serializer.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)