Skip to content

Persist control-plane heartbeats and membership-safe jumbo placement - #40

Merged
loverustfs merged 5 commits into
mainfrom
cursor/scale-control-plane-increment-bda7
Nov 19, 2026
Merged

loverustfs merged 5 commits into
mainfrom
cursor/scale-control-plane-increment-bda7

Conversation

@loverustfs

@loverustfs loverustfs commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Reliability fix on the same pull request. This branch forward-merges current main at d9030543ccca15281803de84dddabb5405fd369d (normal merge, not a rebase). That main includes #35, #38, and #36. This pull request is not merged into main.

This does not deliver trillion scale, a second Cell, disaggregated roles, Jumbo file migration, or automatic leadership transfer. Baidu figures in arXiv:2610.32247 are Baidu production metrics, not results of this repository. No-ship stays in force. A first-ship gate and a scale gate remain separate. Nothing is set to auto-merge. CI was not subscribed.

RegisterCell still fails closed. open_and_serve still rejects every role except all-in-one. Commit a48d038 was not imported. 2PC lease and storage formats were not changed.

Detail is in docs/en/scale-control-plane-status.md.

Review findings

  1. Automatic transfer_leader stays disabled. OpenRaft 0.10 marks a transfer and disables the leader lease before any peer answers TransferLeader. Older peers do not implement that RPC. Node registration is not proof they do. reconcile_jumbo_placement does not call trigger().transfer_leader. The handler stays on RaftTransportService behind the same bearer interceptor as Vote. A 3 second poll is not used. transfer_poll_covers_election(3000, 5000) is false and does not enable the call. [raft] election timeouts from Report readiness from startup state and load Raft options #38 are loaded at group start and are not raced by a transfer poll.
  2. committed_moves does not treat observation as our operation. An already-correct leader does not append LeadershipTransferred. A voter replacement records VoterReplaced only after the uniform voter set matches the plan. A route-file persist failure does not drop that entry.
  3. Directory sync after rename does not roll the sequence back. If rename publishes CELL_CONTROL_PLANE and sync_dir then fails, memory keeps the new state and the caller still gets an error.
  4. Heartbeats stay a local observation. A receiver with no row accepts the sender's observation_generation and current sequence, including values above 64. The same generation still rejects a jump above 64, a stale sequence, and a conflicting body. A different generation is a new baseline. Every remote accept that changes the stored row, including a same-sequence generation replacement, waits 1 second. An identical replay does not write. This process does not keep retired generations: after the rate window a delayed older generation replaces the row again. That is not a scheduling input. The shared bearer remains the only credential. A bound node instance must be repeated. An address-only registration does not gain a second authenticator, so a bearer holder can still overwrite the observation; they cannot make a later honest generation unreadable by pinning the counter.
  5. Control-plane bytes are unambiguous. The CRC32C trailer is checked first. The body must be consumed exactly once by either the current version 1 layout (generation fields present) or the previous version 1 layout (those u128 fields absent). If both layouts match, the file is rejected. Generation ids use getrandom 0.4, which is already in this workspace, instead of /dev/urandom.

Main merge

main d9030543 is merged into this branch. Empty secrets still refuse to serve unless allow_unauthenticated is set for a literal loopback IP. /livez, /readyz, and /healthz keep classify_secret. [raft] timers apply at group start and are not reloaded. Documentation limits from #36 are kept alongside the control-plane limits above. This pull request itself is not merged to main.

Still incomplete

Multi-cell routing, role separation, and moving Jumbo shard files onto another disk are not implemented. A safe automatic leadership transfer is not implemented. Heartbeats are not replicated and are not scheduling truth.

Validation not run

Not executed:

  • cargo test -p metadb-cluster --lib control_plane_state
  • cargo test -p metadb-cluster --test scale_control_plane_tests
  • cargo test -p metadb-server --test control_plane_claim_tests
  • cargo test --workspace --locked
  • any benchmark, three-voter transfer, or multi-cell drill

cargo fmt --all was applied. cargo clippy -p metadb-cluster -p metadb-raft -p metadb-server --all-targets --locked --no-deps -- -D warnings completed with no warnings in those packages. That is a compile/lint check, not a test run.

SHAs

  • Previous head: db84ee34451ee4d7ad0dad572597f25787c24945
  • Merge of main: 8b9315a1940722d6a15547b1167bae2339c8474f (parents db84ee34 and d9030543ccca15281803de84dddabb5405fd369d)
  • Head: c4ef7b82a928c131703e23a44d57be76d909689b
Open in Web Open in Cursor 

cursoragent and others added 5 commits November 19, 2026 19:37
Store node liveness in CELL_CONTROL_PLANE with a monotonic sequence, and
send that record from the maintenance loop without installing shard
descriptors as routes. Jumbo isolation still sets a route flag. A
placement record now says whether a leadership transfer or a same-size
voter replacement was actually committed. Transfers use a new Raft
TransferLeader RPC. A change that would drop fault tolerance or add a
node that has not joined is refused.

This does not add a second cell, split server roles, or move shard files.

Co-authored-by: RustFS <hello@rustfs.com>
…onic

OpenRaft disables the leader lease before TransferLeader is known to
succeed, and older peers do not implement that RPC. Jumbo maintenance
no longer calls trigger().transfer_leader. Registration is not treated
as capability. An already-correct leader is not recorded as this
process's move. A voter replacement that reaches the planned set stays
in committed_moves even when the route file persist fails.

A control-plane rename that then fails the directory sync keeps the new
state in memory so a later write cannot roll the sequence backward.
Remote heartbeats may advance by at most 64 and a new sequence inside
one second is rejected. They remain an unreplicated observation and do
not schedule placement.

Co-authored-by: RustFS <hello@rustfs.com>
Main now includes the explicit auth opt-in and Raft option loading.
Keep those rules and the readiness probes. A receiver with no stored
heartbeat row accepts the sender's observation generation and current
sequence, including values above 64. The same generation still rejects
jumps over 64, stale sequences, conflicting bodies, and fast repeats.
A new generation after the sender file is recreated is a new baseline.
Heartbeats stay unreplicated observations and do not schedule placement.

Co-authored-by: RustFS <hello@rustfs.com>
…plane-increment-bda7

Co-authored-by: RustFS <hello@rustfs.com>

# Conflicts:
#	docs/en/operations.md
A same-sequence generation replacement was accepted inside the one-second
window and rewrote CELL_CONTROL_PLANE. Every remote accept that changes
the stored row now waits, including that replacement. An identical replay
still does not write. The file body must match exactly one layout: the
current version 1 with observation generations, or the previous version 1
without them. Both matching is rejected. Generation ids come from
getrandom instead of /dev/urandom.

Co-authored-by: RustFS <hello@rustfs.com>
@loverustfs
loverustfs merged commit 36f5065 into main Nov 19, 2026
cursor Bot pushed a commit that referenced this pull request Nov 19, 2026
Keep the control-plane observation work from #40 and the anchored
backup checks on this branch.
Co-authored-by: RustFS <hello@rustfs.com>
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.

2 participants