-
Notifications
You must be signed in to change notification settings - Fork 155
Ensure the binary representation of serialized classes is not changed unintendedly #310
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
Conversation
|
Thanks for the PR. This looks like a fine thing to add to me. That said, using kryo for long term storage but depending on a remote library to set the order of the tokens seems really dangerous. I wouldn't use kryo for long term storage full stop.... But I am happy to take a PR so we don't needlessly break people. |
(cherry picked from commit 2a40471)
(cherry picked from commit c6e5b05)
(cherry picked from commit 2ac764b)
(cherry picked from commit 2bf66b8)
(cherry picked from commit 4e5b504)
(cherry picked from commit 22bfcda)
(cherry picked from commit 8531137)
(cherry picked from commit bcf0176)
(cherry picked from commit 81fdfaf)
…have been added by PR 312
|
Thanks! this looks good. |
|
Here are some findings of this PR - for future reference. Currently, there are already some known issues when using kryo/chill for long term persisting data:
Compard to Scala 2.10:
Compard to Scala 2.11:
|
This PR is continuing the idea from PR #303 as follows:
When using kryo/chill for long term storage, it is necessary that classes are serialized in a compatible way when updating to a newer Kryo or Scala version. To ensure this, I have added a spec ensuring that the binary representation of serialized classes is not changed unintendedly due to changes in Kryo or Scala. If changes to the binary representation can't be avoided, at least a compatibility note should be added to the release notes so projects using the library know beforehand whether it's safe to upgrade or not.
The spec I have added is still incomplete and fails for Scala 2.10. This PR is to discuss the spec and its findings:
Does this spec in general make sense to you? Otherwise, I would not continue to work on it, would be wasted time.
For Scala 2.10, this spec fails, because (see lines 47ff) the binary representation of Wrappers$IteratorWrapper has changed between Scala 2.10.7 and Scala 2.11.12. The binary representation in line 51 was created with Scala 2.12.4 and can't be decoded with Scala 2.10.7, a forward compatibility problem. (Note that I have not yet been able to find any backward compatibility problem up to now.) For this specific case, I could write the test in a way that this example is skipped when running on Scala < 2.11. Would that be OK from your point of view?
Please comment ...