-
Notifications
You must be signed in to change notification settings - Fork 22
Add the possibility to handle state evolution without breaking state compatibility #240
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
Comments
I think it is great idea to leverage this concept of the versioned snapshot. It would also great to improve that code related to the "class arity usage", even if breaks state one more time. |
I also think it's not necessary to come back on the class arity breaking change, it was one year ago. It was only a concrete example. What do you think to be conservative and do these breaking changes only for Flink 2, or do you prefer to accept breaking changes also for Flink 1 (semantically it would be a version |
Ok. We can try to make it first on Flink 2 and then evaluate whether it can be also applied to Flink 1. Please check the latest releases I made the other days. |
Hi @novakov-alexey, |
Hi @arnaud-daroussin , I would do it for Flink 1.x if we can implement it with some feature flag to enable versioned snapshot. |
Uh oh!
There was an error while loading. Please reload this page.
Hi @novakov-alexey,
I noticed several
SerializerSnapshot
cannot handle evolutions that break serialization backward compatibility because they don't serialize their version number. And so when reading back the serialized stream, they don't know which version of the serializer wrote it, to be able to react and recover from a previous version.Identified serializer snapshots are:
CollectionSerializerSnapshot
CoproductSerializerSnapshot
MappedSerializerSnapshot
ScalaCaseObjectSerializerSnapshot
Flink provides 2 utility methods to handle this the right way without headache:
An example on how to react on different version numbers can be found here: https://github.com/apache/flink/blob/release-1.20/flink-core/src/main/java/org/apache/flink/api/common/typeutils/CompositeTypeSerializerSnapshot.java#L162
For exemple I think you could have introduced "class arity usage" feature in case class smoothly, without breaking state compatibility with previous versions. Like it is done here: https://github.com/apache/flink/blob/release-1.20/flink-core/src/main/java/org/apache/flink/api/java/typeutils/runtime/RowSerializer.java#L501
Unfortunately, there is no possibility to add usage of version number without breaking state compatibility one last time, that's why I suggest to make this change starting with Flink 2 only, as state compatibility is not an option between Flink 1 and 2 anyway.
What do you think of this?
Do you want to do it yourself, or can I propose a PR?
Thanks
The text was updated successfully, but these errors were encountered: