-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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
[STORM-3566] add serialVersionUID field to class which implement Serializable #3193
Conversation
Thanks for your contribution. |
I have file a JIRA. The link is https://issues.apache.org/jira/browse/STORM-3566. |
Please also update your commit message to prefix with the JIRA number. Thanks. |
…lizable interface
b700a24
to
4499063
Compare
Sorry I have a second thought on this. Although
For example, the user defined Bolt/Spout. User defines their own Bolt/Spout and submits the topology over the network to Nimbus. Eventually supervisors will get the assignment and deserialize bolt/spout and put it to work. But examples like All I am trying to say here is we should think about this carefully and do it case by case. Some useful links:
Thanks for your work on this. |
@Ethanlm I'm not sure. I think we should probably add the field for all bolts and classes serialized as part of bolt state, since these classes are likely to be serialized by the submitter JVM, and then deserialized by the supervisor/worker. For other classes, we should probably look at whether they get serialized by one JVM, and then deserialized by another. If they are, we should add the field, and will then have to remember to change the value if we add/change fields in PRs. Regarding whether we remember to update the field, I think there might be a compatibility issue in the current code. As it is now, I think we can't change state in any of the serializable classes that are not packaged in topology jars without breaking user code due to changed UID. This would for example include the bolts in storm-client. I think if we change a class there, we would run into issues with rolling upgrades, since e.g. Nimbus might be running 2.1.0, and the worker might be running 2.0.1, and the version of the class that is loaded depends on the Storm version instead of depending on the contents of the topology jar. For classes that get packaged as part of the topology jar (e.g. any bolts in the externals or examples), we should be fine. I'm not sure how to solve the compatibility issue (assuming it exists), without moving the serializable classes out of storm-client, and into another module that we then require topology jars to package. |
@srdo Thanks. I agree with you |
@howardliu-cn I think we need to distinguish what classes should be added with serialVersionUID and what shouldn't because of the reasons we discussed above. The decision needs to be made case by case. serialVersionUID shouldn't be added blindly. |
[STORM-3566]add serialVersionUID field to class which implement Serializable interface.