Skip to content

fix(dst): resolve Carbon audit P0/P1 quorum, lock, clock, network, concurrency, and tautology findings - #12

Merged
loverustfs merged 1 commit into
mainfrom
fix/carbon-audit-hardening
Nov 28, 2026
Merged

loverustfs merged 1 commit into
mainfrom
fix/carbon-audit-hardening

Conversation

@loverustfs

Copy link
Copy Markdown
Contributor

Closes #11

Summary

Resolves all P0, P1, and P2 findings identified in the independent Carbon audit across rustfs-dst-runtime, rustfs-dst-faults, rustfs-dst-sim, and rustfs-dst-cli:

  1. [D-01] [P0] SimECStore Two-Phase StageShard/CommitShard & k == m (3x2, 4x2) Quorum Linearizability:
    • Separated Phase 1 (StageShard in .rustfs.sys/tmp/<tx_id>) from Phase 2 (CommitShard), ensuring writes failing stage quorum never publish partial xl.meta files on disk.
    • Enforced cumulative write-quorum support (votes + skipped_higher_votes + unreachable >= write_quorum) across get_object, list_objects, and heal_object, preventing sub-write-quorum k-shard orphans on 3x2/4x2 from shadowing older committed versions or being promoted during heal.
  2. [D-02] [P1] SimNetwork::call ReplyDroppedAfterApply Soundness:
    • Gated ReplyDroppedAfterApply strictly on response.is_ok() so failed remote handler executions are never misclassified as indeterminate applied writes.
  3. [D-03] [P1] Unconditional Backup-Less Rollback Cleanup:
    • handle_rollback now removes uncommitted xl.meta and version directories whenever xl.meta.bkp is absent, even when failed_generation > 1 on a drive that missed earlier generations.
  4. [D-04] [P1] NodeLockService Crash-Safe Lease Recovery Grace & Epoch Bump:
    • Added a monotonic lease-recovery grace barrier and +1000 fencing epoch bump on clear_on_crash(), preventing 3-node single-server crash/reboot split-brain.
  5. [D-05] [P1] SimClock Monotonicity Under Drift Changes & clear_faults():
    • Integrated node_drift_ppm incrementally per advance() step so now_instant() never moves backward when faults are cleared.
  6. [D-06] [P1] Concurrent JoinSet Quorum Fanouts & Multi-Writer CAS Race Test:
    • Converted sequential for-loop quorum RPCs in SimECStore and QuorumLockClient into concurrent JoinSet fanouts while preserving deterministic slot-order aggregation.
  7. [D-07] [P2] Multi-Seed Must-Hit Enforcement for Sometimes & Reachable Probes:
    • rustfs-dst run (when seeds >= 5) now fails closed if any registered Sometimes or Reachable probe has pass_count == 0.
  8. [S-01..S-04] [P1/P2] Replaced Tautological Constant Checks with Stateful Fault Simulations:
    • Replaced constant expressions in scanner.rs, enterprise_data.rs, security_obs.rs, pools.rs, and replication.rs with stateful 100s lease-heartbeat persistence, topology/load-aware Deep pacer, two-step SimDiskIo restore copy-back barrier, lock-free status reads under held namespace quorum lock, real try_delete_namespace, HLC causal stamps, and cross-pool generation union without omniscient global_deleted shortcuts.

Verification

  • cargo fmt --all -- --check & cargo clippy --workspace --all-targets -- -D warnings — 0 warnings
  • cargo test --workspace — 38/38 unit & integration tests pass
  • rustfs-dst verify-determinism (4x4 & 3x2) — 33/33 bit-exact replay pass
  • rustfs-dst run --scenario all --seeds 25 (4x4 & 3x2) — 1,650/1,650 runs pass, 0 unhit must-hit probes

@loverustfs
loverustfs merged commit 58698e3 into main Nov 28, 2026
1 check passed
@loverustfs
loverustfs deleted the fix/carbon-audit-hardening branch November 28, 2026 05:12
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.

fix(dst): resolve Carbon audit P0/P1 protocol, runtime, concurrency, and tautology findings

1 participant