remove the Akka 2.6.4 rolling-migration manifests from ClusterMessageSerializer - #3516
Open
pjfanning wants to merge 1 commit into
Open
remove the Akka 2.6.4 rolling-migration manifests from ClusterMessageSerializer#3516pjfanning wants to merge 1 commit into
pjfanning wants to merge 1 commit into
Conversation
…Serializer Motivation: The Old* and *Pre2523 manifest vals were kept "for one version iteration from Akka 2.6.4" to allow rolling migration to short manifests, removable "in Akka 2.6.6 or later". No peer a Pekko node can talk to emits them: Pekko has always emitted the short manifests, and an actual old Akka node would emit akka.cluster.* strings, which these org.apache.pekko.cluster.* constants (renamed in the fork) can never match. Each dead branch was a wire-reachable deserialization path. Modification: Remove the vals, their fromBinary cases, and the two heartbeat deserializers only those cases used. Replace the spec's old-manifest round-trip tests and their now-unused helpers with a test asserting every removed manifest is rejected as unknown. Result: The class-based manifests are refused with "Unknown manifest". Short manifests are unchanged. Tests: - sbt "cluster/testOnly org.apache.pekko.cluster.protobuf.ClusterMessageSerializerSpec" - 8 passed - the new rejection test fails without the production change (the manifest routes to deserializeJoin and raises InvalidProtocolBufferException) - sbt "cluster/mimaReportBinaryIssues" - no issues - sbt "cluster/scalafmtCheckAll" - clean References: None - removes dead Akka 2.6.4 compatibility code
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation
ClusterMessageSerializerstill accepted the long class-based manifests kept "for oneversion iteration from Akka 2.6.4 to allow rolling migration to short manifests", marked
removable "in Akka 2.6.6 or later" — the thirteen
Old*/*Pre2523vals and theirfromBinarybranches.No peer a Pekko node can talk to emits them:
J,W,GE, …) — the long form wasonly ever sent by Akka ≤ 2.6.4.
akka.cluster.InternalClusterAction$Joinandfriends. These constants were renamed to
org.apache.pekko.cluster.*by the fork'spackage rename, and nothing in
pekko-remotetranslates manifests, so they can nevermatch what such a node sends either.
So every branch is dead code — and each one is a wire-reachable deserialization path,
which is exactly the surface the recent serializer hardening has been shrinking.
Modification
Remove the vals, their
fromBinarycases, and the two heartbeat deserializers only thosecases used (
deserializeHeartBeatAsAddress,deserializeHeartBeatRspAsUniqueAddress).In the spec, remove the old-manifest round-trip tests and their now-unused helpers
(
roundtripWithManifest,checkDeserializationWithManifest), and add a test assertingevery removed manifest is now rejected as an unknown manifest.
Result
The class-based manifests are refused with
IllegalArgumentException("Unknown manifest [...]")like any other unrecognised manifest. Handling of the short manifests isunchanged.
Tests
sbt "cluster/testOnly org.apache.pekko.cluster.protobuf.ClusterMessageSerializerSpec"— 8 passedand re-running: it then fails because the old manifest routes into
deserializeJoin,which raises
InvalidProtocolBufferExceptionon the test payload instead of theunknown-manifest rejection.
sbt "cluster/mimaReportBinaryIssues"— no issuessbt "cluster/scalafmtCheckAll"— cleanReferences
None — removes dead Akka 2.6.4 compatibility code.