Skip to content

feat(cluster)!: link replicas across releases listed as compatible - #5084

Open
spetz wants to merge 4 commits into
masterfrom
cluster_nodes_compat
Open

spetz wants to merge 4 commits into
masterfrom
cluster_nodes_compat

Conversation

@spetz

@spetz spetz commented Nov 25, 2026

Copy link
Copy Markdown
Contributor

A replica hashes its release into the build identity that both halves
of the replica handshake compare for equality. Every version bump, a
patch included, therefore made a node refuse all of its peers, even
when the replica protocol, the storage format and the replicated
logic had not changed. A cluster could only be upgraded with every
node down.

The server now holds a release compatibility table: one row per
release, with the releases it can share a cluster with. Two releases
link when they are equal or when the row of either one lists the
other. A release is matched by its exact version string, so a release
that no pair names, such as a fork under its own version, links only
with itself. The table ships empty, because no released pair is
compatible yet.

Only the binary that holds a row knows it, and an earlier release
cannot learn of a later one. So the node with the row speaks as the
release it lists. A ReplicaHello carries the identity of the dialer
in its header and, as its body, the identities of the releases the
dialer lists, 128 at most. The acceptor picks the identity of the
link: that of the dialer when it is its own or one it lists, its own
when the body contains it. The challenge and the finish carry that
identity, and the node without the row only ever sees its own. With
cluster.auth on, both MACs cover that identity and a hash of the
whole hello, so a hello altered in transit fails the handshake.

A listed identity is hashed with the client protocol, the replica
wire revision and the storage marker of the build that lists it, so a
row cannot link a release that differs in one of them. What a row
asserts, and nothing checks, is that the state transfer formats and
the replicated logic are the same.

The table is compiled in, not configured: an operator who could set
it could link releases whose state machines differ. It holds explicit
pairs, not a version range, because a range admits a fork or a bad
release that sorts inside it. Its test requires a direct pair between
any two releases that link with a common third one, and a valid
version in every entry.

REPLICA_WIRE_REVISION goes from 4 to 5. A build from before this
change ignores the hello body, so a release that listed such a build
would link only where the old build dials. With the bump that build
matches no listed identity. Builds from before and after this change
refuse each other, so stop every node and start them all on the new
build. The storage format does not change and the data directories
stay.

@spetz spetz added the breaking:replica-to-replica-protocol Replica-to-replica protocol change. No version negotiation; requires coordinated restart. label Nov 25, 2026
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Nov 25, 2026
@codecov

codecov Bot commented Nov 25, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 97.10843% with 12 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.15%. Comparing base (817a298) to head (d5f222b).

Files with missing lines Patch % Lines
core/server/src/boot/mod.rs 50.00% 6 Missing ⚠️
core/message_bus/src/replica/handshake.rs 96.11% 4 Missing ⚠️
core/server/src/release_compatibility.rs 99.28% 2 Missing ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##             master    #5084      +/-   ##
============================================
- Coverage     92.16%   92.15%   -0.01%     
  Complexity     4356     4356              
============================================
  Files          1574     1575       +1     
  Lines        417733   418118     +385     
  Branches     346248   346634     +386     
============================================
+ Hits         384989   385311     +322     
- Misses        27256    27323      +67     
+ Partials       5488     5484       -4     
Components Coverage Δ
Rust Core 93.49% <97.10%> (-0.01%) ⬇️
Java SDK 80.98% <ø> (-0.03%) ⬇️
C# SDK 86.25% <ø> (-0.15%) ⬇️
Python SDK 85.54% <ø> (+0.01%) ⬆️
PHP SDK 90.35% <ø> (ø)
Node SDK 97.25% <ø> (ø)
Go SDK 73.79% <ø> (+0.12%) ⬆️
C++ SDK 85.29% <ø> (ø)
Files with missing lines Coverage Δ
core/binary_protocol/src/version.rs 100.00% <ø> (ø)
core/message_bus/src/lib.rs 97.04% <100.00%> (+<0.01%) ⬆️
core/message_bus/src/replica/auth.rs 96.25% <100.00%> (+0.17%) ⬆️
core/server/src/lib.rs 100.00% <ø> (ø)
core/server/src/release_compatibility.rs 99.28% <99.28%> (ø)
core/message_bus/src/replica/handshake.rs 87.40% <96.11%> (+1.30%) ⬆️
core/server/src/boot/mod.rs 86.69% <50.00%> (-0.42%) ⬇️

... and 45 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Comment thread core/binary_protocol/src/version.rs Resolved
Comment thread docs/server/upgrading.mdx Resolved
@github-actions github-actions Bot added S-waiting-on-author PR is waiting on author response and removed S-waiting-on-review PR is waiting on a reviewer labels Nov 25, 2026
@spetz

spetz commented Nov 25, 2026

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions github-actions Bot added S-waiting-on-review PR is waiting on a reviewer and removed S-waiting-on-author PR is waiting on author response labels Nov 25, 2026

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

breaking:replica-to-replica-protocol Replica-to-replica protocol change. No version negotiation; requires coordinated restart. S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants