Skip to content

Add scale-in, bounded CI load, ID namespace tests, and CI gate docs - #22

Merged
loverustfs merged 3 commits into
mainfrom
cursor/scale-in-ci-gates-ec59
Nov 19, 2026
Merged

loverustfs merged 3 commits into
mainfrom
cursor/scale-in-ci-gates-ec59

Conversation

@loverustfs

@loverustfs loverustfs commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

Summary

Adds white-box tests and CI-gate documentation that can merge without product or runtime changes. .github/workflows/ci.yml is not edited. This does not merge.

A green ci.yml run is not production readiness and is not evidence that the official million-operation load passed.

New files

  • crates/metadb-cluster/tests/membership_retarget_tests.rs — plan_membership_voters: grow from the lowest registered ids, shrink from the highest ids, ensure_node, refusal of target 0, refusal of node id 0, and not enough registered nodes.
  • crates/metadb-server/tests/scale_in_restart_tests.rs — three localhost voters in one OS process shrink to 2 and to 1 via DurableCellManager::scale_out_replicas, then the same data directories are reopened. Acknowledged writes stay readable, the Raft voter set matches the target, and the checked path records zero application errors. The persisted voter set is decoded from CELL_MANAGER_STATE on disk. list_routes overlays that file with live Raft membership, so the test does not use it for the disk check.
  • crates/metadb-server/tests/ci_bounded_prefix_load.rs — reduced CI fixture: 4 prefixes × 25 creates, then 50 overwrite/delete operations, concurrency 4. Asserts errors == 0 and correctness_errors == 0.
  • crates/metadb-cluster/tests/id_namespace_join_tests.rs — DurableIdAllocator::open_for_node for node ids in 1..=32767. Fresh node>1 directories start in that node's namespace. A dirty allocator reopens from stored counters and is not relocated.
  • docs/en/ci-and-release-gates.md — current CI (fmt, clippy -D warnings, cargo test --workspace --locked, packaging, 45-minute timeout on ubuntu-24.04) and what those gates do not prove.
  • .github/workflows/dependency-audit.yml — cargo-audit 0.23.0 and cargo-deny 0.21.0 on pull_request and push. cargo deny still runs when cargo audit has already failed, and the job stays failed if either command fails. Branch protection is unchanged.
  • deny.toml — initial reporting config for that workflow.

metadb-server's dev-dependencies declare wincode so the scale-in test can decode the cell-state file. Cargo.lock records that edge. No runtime code changed.

How to run

cargo test -p metadb-cluster --test membership_retarget_tests --test id_namespace_join_tests
cargo test -p metadb-server --test scale_in_restart_tests --test ci_bounded_prefix_load -- --test-threads=1
cargo fmt --all -- --check
cargo clippy -p metadb-cluster -p metadb-server --all-targets --locked -- -D warnings

cargo test --workspace --locked already runs the new integration tests, so the existing CI test step picks them up without a workflow edit.

Locally on this commit: membership 6 passed, ID namespace 4 passed, scale-in 2 passed (including the on-disk voter check before and after restart), bounded prefix load 1 passed. Clippy -D warnings on metadb-server passed after the disk-decode change.

CI versus three VMs

  • The bounded prefix load is a reduced CI fixture only. It is not the official load, not a 1,000,000-op load, and not a paper-scale or production benchmark.
  • The official load stays on three VMs: 100 prefixes × 10,000 creates + 100,000 overwrite/delete at concurrency 64.
  • In-process 3→2 and 3→1 scale-in plus restart does not replace three-VM scale-out or scale-in evidence.
  • The dependency-audit workflow is an initial reporting job, not a production-grade supply-chain program.

Dependency audit will fail on known unmaintained crates

cargo audit reported three unmaintained advisories and no vulnerability advisories:

  • chrono 0.4.45 — RUSTSEC-2026-0543
  • chrono-tz 0.8.6 — RUSTSEC-2026-0555
  • chrono-tz-build 0.2.1 — RUSTSEC-2026-0559

No fixed upgrade was listed. They come in through openraft. This PR does not change those crates. cargo audit -D unmaintained and cargo deny --locked check advisories both fail on those three findings, so Dependency audit is expected to be red. Deny still runs after that audit failure. cargo deny --locked check licenses bans sources exited 0; duplicate crate versions were warnings only. Licenses matched were Apache-2.0, MIT, BSD-3-Clause, Unicode-3.0, and Zlib.

Overlap left out

A parallel agent (bc-fd965b0c-73ba-5043-aa19-dd2247eff7f5, no GitHub PR when this branch was cut) is writing regression and stress fixtures from the same base commit. It had already committed edits to:

  • crates/metadb-server/tests/prefix_load.rs (a different CI shape: 2 prefixes × 8 creates, then SetAttr and deletes)
  • crates/metadb-server/tests/auth_fail_closed.rs
  • docs/en/testing.md
  • docs/en/configuration.md
  • docs/en/operations.md
  • .github/workflows/ci.yml

This PR does not edit those files. The required 4×25 fixture is the new file ci_bounded_prefix_load.rs, so it is picked up by cargo test --workspace without taking ownership of ci.yml or docs/en/testing.md. No required deliverable was dropped.

Open in Web Open in Cursor 

These are new tests and a reporting workflow only. Product and runtime code are unchanged, and the existing ci.yml workflow is not edited.

Co-authored-by: RustFS <hello@rustfs.com>
Copilot AI balanced review requested due to automatic review settings November 19, 2026 11:48

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 Changes recommended

The dependency audit workflow skips cargo deny after audit failures, and the restart test checks live membership rather than independently verifying persisted voters.

2 open issues
What changed in this PR

Adds regression tests and dependency-audit reporting while documenting what CI does—and does not—prove. Runtime code and the existing ci.yml workflow remain unchanged.

Changes:

  • Adds membership-planner, ID-namespace, and in-process scale-in/restart tests.
  • Adds a bounded load fixture with 100 creates and 50 mutations at concurrency 4.
  • Introduces dependency-audit checks and documents CI gates, known advisory failures, and the separate three-VM validation requirements.
File Description
docs/​en/​ci-and-release-gates.md Documents CI checks, release prerequisites, and validation limits.
deny.toml Configures dependency advisory, license, version, and source checks.
crates/​metadb-server/​tests/​scale_in_restart_tests.rs Tests three-to-two and three-to-one scale-in followed by graceful restart.
crates/​metadb-server/​tests/​ci_bounded_prefix_load.rs Adds a reduced concurrent load fixture with correctness assertions.
crates/​metadb-cluster/​tests/​membership_retarget_tests.rs Tests voter growth, shrinkage, ensured joins, and invalid inputs.
crates/​metadb-cluster/​tests/​id_namespace_join_tests.rs Tests fresh allocator namespaces and stored-counter preservation on reopen.
.github/​workflows/​dependency-audit.yml Adds cargo-audit and cargo-deny checks for pushes and pull requests.

Review effort: Balanced

Comment on lines +39 to +40
- name: cargo deny
run: cargo deny --locked check
}

fn persisted_voters(cluster: &PersistentMetaDbCluster) -> BTreeSet<u64> {
let routes = cluster.cell_manager().list_routes();
cursoragent and others added 2 commits November 19, 2026 11:55
CELL_MANAGER_STATE is decoded directly so the shrink check does not use the live Raft overlay from list_routes. The audit workflow still runs cargo deny after a failing cargo audit, and the job stays failed when audit reports findings.

Co-authored-by: RustFS <hello@rustfs.com>
The scale-in test decodes CELL_MANAGER_STATE with wincode, and the locked CI build needs that edge in the lockfile.

Co-authored-by: RustFS <hello@rustfs.com>
@loverustfs
loverustfs merged commit 76896c2 into main Nov 19, 2026
5 of 9 checks passed
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.

3 participants