Skip to content

remove the Akka 2.6.4 rolling-migration manifests from ClusterMessageSerializer - #3516

Open
pjfanning wants to merge 1 commit into
apache:mainfrom
pjfanning:remove-akka26-manifest-compat
Open

remove the Akka 2.6.4 rolling-migration manifests from ClusterMessageSerializer#3516
pjfanning wants to merge 1 commit into
apache:mainfrom
pjfanning:remove-akka26-manifest-compat

Conversation

@pjfanning

Copy link
Copy Markdown
Member

Motivation

ClusterMessageSerializer still accepted the long class-based manifests kept "for one
version 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* / *Pre2523 vals and their
fromBinary branches.

No peer a Pekko node can talk to emits them:

  • Pekko has always emitted the short manifests (J, W, GE, …) — the long form was
    only ever sent by Akka ≤ 2.6.4.
  • An actual old Akka node would send akka.cluster.InternalClusterAction$Join and
    friends. These constants were renamed to org.apache.pekko.cluster.* by the fork's
    package rename, and nothing in pekko-remote translates manifests, so they can never
    match 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 fromBinary cases, and the two heartbeat deserializers only those
cases used (deserializeHeartBeatAsAddress, deserializeHeartBeatRspAsUniqueAddress).

In the spec, remove the old-manifest round-trip tests and their now-unused helpers
(roundtripWithManifest, checkDeserializationWithManifest), and add a test asserting
every 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 is
unchanged.

Tests

  • sbt "cluster/testOnly org.apache.pekko.cluster.protobuf.ClusterMessageSerializerSpec" — 8 passed
  • The new rejection test was checked to discriminate by reverting the production change
    and re-running: it then fails because the old manifest routes into deserializeJoin,
    which raises InvalidProtocolBufferException on the test payload instead of the
    unknown-manifest rejection.
  • sbt "cluster/mimaReportBinaryIssues" — no issues
  • sbt "cluster/scalafmtCheckAll" — clean

References

None — removes dead Akka 2.6.4 compatibility code.

…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
@pjfanning pjfanning added this to the 2.0.0-M5 milestone Sep 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant