Akka Cluster Serialization Binding Incompatibility with Akka Persistence Journal During Rolling Upgrade
0 reputation · 20 May 2022, 15:02 UTC
0 reputation · 20 May 2022, 15:02 UTC
The goal is to determine whether persistent actors can recover journal state when serializer bindings differ between upgraded and legacy nodes in an Akka Cluster undergoing a rolling upgrade. Incompatible serializer versions may trigger member exits before recovery completes, preventing persistent actors from accessing journal state.
Journal replay may stall if the underlying journal plugin schema changes between Akka versions, as no automatic backward-migration exists for snapshot or event formats. CoordinatedShutdown interactions with persistent timers and snapshot cleanup are version-sensitive, potentially leaving actors in recovery limbo when nodes operate beyond the supported rolling upgrade window.
What conditions cause serializer version mismatches to trigger member exits before persistent actor recovery completes? Which serialization binding configurations prevent silent data loss when rolling Akka cluster versions across persistent actors? Can cluster sharding entity passivation be automated when journal schema changes between Akka versions without manual state re-initialization?
35275 reputation · 20 May 2022, 16:29 UTC
A serializer binding mismatch does not directly eject a cluster member. It becomes an exit risk when a node cannot deserialize cluster gossip, sharding messages, or persistent actor commands from a peer. The resulting failure can make the node appear unreachable to the failure detector or crash the actor system, triggering exit. If a node exits while a persistent actor is replaying its journal, recovery stops and the actor cannot read journal state until the node rejoins with a compatible serializer.
Likely, not confirmed: member exits during a mixed-version rollout correlate with deserialization failures on legacy or upgraded nodes, and CoordinatedShutdown may terminate the actor system before replay completes.
Confirmed behavior: Akka Persistence does not automatically migrate journal or snapshot formats between versions. Removing a serializer binding for a class still present in journaled events makes those events unreadable. Cluster sharding passivation only affects in-memory entity passivation and shard rebalancing; it does not convert or clear journal state, so a reactivated entity replays the same incompatible journal and fails without manual migration.
akka.actor.serialization-bindings; avoid default Java serialization for persistent state.akka.coordinated-shutdown so shutdown does not run while persistent actors are recovering; timing is version- and plugin-specific.Automating entity passivation cannot bypass a journal schema change. Passivation removes the in-memory entity and may rebalance the shard, but activation replays the existing journal. Without manual state migration or re-initialization, reactivated entities fail on the same incompatible events.
This assumes standard Akka Cluster with Akka Persistence, no custom downing provider, and default failure-detection settings. Exact CoordinatedShutdown behavior across versions requires testing your specific setup.
Which Akka version and journal plugin are you using? Schema compatibility and serialization behavior are plugin- and version-specific, and that detail determines whether binding retention alone is sufficient or whether journal migration is required.
Use comments to ask for clarification. Post a solution as an answer.
No question comments on this page.