-
Notifications
You must be signed in to change notification settings - Fork 152
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
Enable deserialization of old Akka cluster messages (mixed pekko/akka cluster) #1578
base: main
Are you sure you want to change the base?
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 | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
@@ -177,6 +177,14 @@ class ClusterMessageSerializerSpec extends PekkoSpec("pekko.actor.provider = clu | |||||||||||||||||||||||||||||||
ClusterMessageSerializer.OldWelcomeManifest) | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
"be de-serializable with class manifests from Akka nodes" in { | ||||||||||||||||||||||||||||||||
val oldAkkaJoinAckManifest = s"org.apache.pekko.cluster.InternalClusterAction$$InitJoinAck" | ||||||||||||||||||||||||||||||||
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. @sadekmunawar this class only needs to be supported for Akka prior to v2.6.4. Do we really need to support clusters that are running with very old Akka releases? Ideally we would only support pretty recent Akka releases. It is a pity that Akka changed the cluster messages in a patch release (2.6.5). pekko/cluster/src/main/scala/org/apache/pekko/cluster/protobuf/ClusterMessageSerializer.scala Lines 44 to 58 in 5d4e828
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 would be worried that if we need to support the old Akka messages as well as the newer format that changes will also need to made to toBinary too because that would possibly leak class names with pekko package names that Akka nodes will not understand. 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 upgraded from Akka-2.6.2, so this change was necessary. But updating the documentation to advise users to perform the rolling upgrade from a version higher than 2.6.4 may be sufficient. An alternative approach would be to revert the old manifest back to Akka (e.g. |
||||||||||||||||||||||||||||||||
val address = Address("akka", "system", "some.host.org", 4711) | ||||||||||||||||||||||||||||||||
checkDeserializationWithManifest( | ||||||||||||||||||||||||||||||||
InternalClusterAction.InitJoinAck(address, CompatibleConfig(ConfigFactory.empty)), | ||||||||||||||||||||||||||||||||
oldAkkaJoinAckManifest) | ||||||||||||||||||||||||||||||||
} | ||||||||||||||||||||||||||||||||
|
||||||||||||||||||||||||||||||||
"add a default data center role to gossip if none is present" in { | ||||||||||||||||||||||||||||||||
val env = roundtrip(GossipEnvelope(a1.uniqueAddress, d1.uniqueAddress, Gossip(SortedSet(a1, d1)))) | ||||||||||||||||||||||||||||||||
env.gossip.members.head.roles should be(Set(ClusterSettings.DcRolePrefix + "default")) | ||||||||||||||||||||||||||||||||
|
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.
this is only needed when migrating from Akka, may be better under a boolean guard.
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.
IIRC, @mdedetrich once added one, and then is can be
if (guard && manifest.startsWith("akka"))
, WDYTThere 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.
I can provide a PR for this based on checking
pekko.remote.accept-protocol-names
config. That config is an array value and if "akka" is in the array then we can allow this check. We only need to do this config once so the boolean result can be stored as a val.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.
I agree. If we decide to keep the changes in this PR, then having boolean guard would be better.