[ https://issues.apache.org/jira/browse/FLINK-37524?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17937876#comment-17937876 ]
Yue Ma edited comment on FLINK-37524 at 3/24/25 12:43 PM: ---------------------------------------------------------- [~Yanfei Lei] Yes , that what i mean Can we directly replace StateDescriptor<V>with TypeSerializer<V>in the construction method of `AbstractKeydState` ? just like this {code:java} public AbstractKeyedState( StateRequestHandler stateRequestHandler, TypeSerializer<V> valueSerializer) { this.stateRequestHandler = stateRequestHandler; this.valueSerializer = ThreadLocal.withInitial(valueSerializer::duplicate); } {code} was (Author: mayuehappy): [~Yanfei Lei] Yes , that what i mean Can we directly replace StateDescriptor<V>with TypeSequencer<V>in the construction method of `AbstractKeydState` ? just like this {code:java} public AbstractKeyedState( StateRequestHandler stateRequestHandler, TypeSerializer<V> valueSerializer) { this.stateRequestHandler = stateRequestHandler; this.valueSerializer = ThreadLocal.withInitial(valueSerializer::duplicate); } {code} > 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 > Assignee: 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)