Skip to content

feat(metadata): state transfer for snapshot and client table - #3765

Open
numinnex wants to merge 15 commits into
masterfrom
state_transfer_metadata_clients_table
Open

feat(metadata): state transfer for snapshot and client table#3765
numinnex wants to merge 15 commits into
masterfrom
state_transfer_metadata_clients_table

Conversation

@numinnex

Copy link
Copy Markdown
Contributor

No description provided.

numinnex and others added 11 commits July 27, 2026 09:58
# Conflicts:
#	core/common/src/error/iggy_error.rs
#	core/consensus/src/client_table.rs
#	core/consensus/src/metadata_helpers.rs
#	core/integration/tests/cluster/client_table_restart.rs
#	core/metadata/src/impls/metadata.rs
#	core/metadata/src/impls/recovery.rs
#	core/metadata/src/lib.rs
#	core/sdk/src/vsr.rs
#	core/server-ng/src/bootstrap.rs
#	core/server-ng/src/dispatch.rs
# Conflicts:
#	core/consensus/src/impls.rs
#	core/shard/src/lib.rs
Master's clients_table_max knob (#3756) calls set_capacity after
install_client_table, but WAL-replay recovery repopulates the table
before bootstrap reaches either call, so every restart with a
registered client tripped the "set_capacity must run before any
client registers" assert and the node refused to boot. Order the
capacity set before the install, build the recovered table at the
configured capacity instead of the compile-time default, and plumb
the same knob into the shard's state-transfer decode so an installed
table never falls back to the default either.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Checkpoints are node-local, so a healthy serving primary can offer a
snapshot behind the receiver's own applied frontier (a backup
checkpoints an op or two below the primary it later replaces). The
install blindly restored that snapshot in place, rewinding the state
machine below commit_min with no way back: the commit walk never
revisits ops it already counted as applied, so the rewound-over
effects were silently lost. Keep the local STM in that case and
install only the client table, which comes from the serving primary's
live state and is never behind.

Caught by new checkpoint-shaped state-transfer specs (restart exactly
at a drained journal, multiple snapshot generations, double restart),
which also grow the harness with ANSI-stripped stdout markers and an
occurrence counter, and promote the forced-checkpoint log to info so
tests can pin checkpoint placement.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@github-actions github-actions Bot added the S-waiting-on-review PR is waiting on a reviewer label Jul 28, 2026
numinnex and others added 4 commits July 28, 2026 14:18
server-ng has served HTTP for a while (roster bind, advertised
addresses, vsr-only http_rbac/http_tls suites), but two race tests
still excluded the transport under vsr behind a stale "server-ng
exposes no HTTP listener" note that came back with a stash-pop.
Unify the concurrent-addition matrix (80 cells in both modes) and the
segment-rotation race to all four transports; the 20 HTTP cells and
the rotation race run green against a 3-node vsr cluster.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@codecov

codecov Bot commented Jul 28, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 74.87%. Comparing base (f88e8a8) to head (465d922).
⚠️ Report is 1 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master    #3765      +/-   ##
============================================
- Coverage     74.91%   74.87%   -0.04%     
  Complexity      969      969              
============================================
  Files          1307     1307              
  Lines        152252   152157      -95     
  Branches     127684   127666      -18     
============================================
- Hits         114052   113922     -130     
+ Misses        34682    34642      -40     
- Partials       3518     3593      +75     
Components Coverage Δ
Rust Core 75.28% <ø> (+<0.01%) ⬆️
Java SDK 62.71% <ø> (ø)
C# SDK 71.17% <ø> (-1.03%) ⬇️
Python SDK 92.27% <ø> (ø)
PHP SDK 84.52% <ø> (ø)
Node SDK 92.23% <ø> (-0.02%) ⬇️
Go SDK 43.08% <ø> (ø)
Files with missing lines Coverage Δ
core/binary_protocol/src/consensus/command.rs 100.00% <ø> (ø)
core/binary_protocol/src/consensus/header.rs 80.35% <ø> (ø)
core/consensus/src/client_table.rs 92.88% <ø> (ø)
core/consensus/src/impls.rs 75.63% <ø> (+<0.01%) ⬆️
core/consensus/src/lib.rs 0.00% <ø> (ø)
core/consensus/src/metadata_helpers.rs 91.77% <ø> (+0.34%) ⬆️
core/consensus/src/observability.rs 40.17% <ø> (+0.08%) ⬆️
core/consensus/src/plane_helpers.rs 94.50% <ø> (+0.11%) ⬆️
core/journal/src/lib.rs 0.00% <ø> (ø)
core/journal/src/prepare_journal.rs 88.67% <ø> (ø)
... and 16 more

... and 27 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.

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

Labels

S-waiting-on-review PR is waiting on a reviewer

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant