-
Notifications
You must be signed in to change notification settings - Fork 13.9k
[FLINK-37553] Make ForStKeyedStateBackend update NamespaceSerializer during restoring state #26416
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -445,6 +445,22 @@ private <N, UK, SV> RegisteredKeyValueStateBackendMetaInfo<N, SV> updateRestored | |
|
|
||
| RegisteredKeyValueStateBackendMetaInfo<N, SV> restoredKvStateMetaInfo = oldStateInfo.f1; | ||
|
|
||
| // fetch current namespace serializer now because if it is incompatible, we can't access | ||
| // it anymore to improve the error message | ||
| TypeSerializer<N> previousNamespaceSerializer = | ||
| restoredKvStateMetaInfo.getNamespaceSerializer(); | ||
|
|
||
| TypeSerializerSchemaCompatibility<N> s = | ||
| restoredKvStateMetaInfo.updateNamespaceSerializer(namespaceSerializer); | ||
| if (s.isCompatibleAfterMigration() || s.isIncompatible()) { | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I am curious about the difference between It would even better if the compatibility checks returned the reason for the incompatibility. Maybe throwing an exception in a checkIncompatibility method and construct different messages in the Exception might be better as we then log out the root cause of the incompatibility. WDYT?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mayuehappy We could distinguish the messages for two cases. For the
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @Zakelly Thanks for the reply. As I remember,
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @mayuehappy we can keep it if so. |
||
| throw new StateMigrationException( | ||
| "The new namespace serializer (" | ||
| + namespaceSerializer | ||
| + ") must be compatible with the old namespace serializer (" | ||
| + previousNamespaceSerializer | ||
| + ")."); | ||
| } | ||
|
|
||
| restoredKvStateMetaInfo.checkStateMetaInfo(stateDesc); | ||
|
|
||
| // fetch current serializer now because if it is incompatible, we can't access it anymore to | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: is the New in the method name required?
registerNewSerializerForRestoredState -> registerSerializerForRestoredState
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well this is the name of existing interface, we'd better keep this in current PR.