Skip to content

Fix DST durability, quorum visibility, and turmoil false confidence - #5

Merged
loverustfs merged 2 commits into
mainfrom
cursor/dst-audit-fixes-f760
Nov 28, 2026
Merged

loverustfs merged 2 commits into
mainfrom
cursor/dst-audit-fixes-f760

Conversation

@loverustfs

Copy link
Copy Markdown
Contributor

Summary

Audit of this DST framework against current rustfs/rustfs main (erasure-coding spec, MetadataQuorumAccumulator, FileInfo distribution) and the S3 consistency rules RustFS implements. Fixes are limited to checks that were wrong or that let a failing seed look green.

Findings and changes

Severity Finding Change
High SimDiskIo made a new file durable on fsync_file alone (ensure_parents inserted it into the durable image) and fsync_dir copied dirty file bytes. Crash tests could pass when a rename or data fsync was missing. Inode model: fsync_file persists bytes only; fsync_dir persists names and does not flush dirty data. fsync_dir also links that directory from the root so the existing commit sequence (which fsyncs the object dir and bucket, not the filesystem root) still survives power loss.
High On 3x2 / 4x2, GET treated a delete marker as authoritative at read quorum (data_shards). RustFS early-stop accepts a delete marker only at default_write_quorum() (data+1 when data == parity). Three of six delete markers hid a live object, and heal then copied that marker onto every drive. Delete markers are visible and healable only at write quorum. A newer generation that cannot have been committed and cannot be reconstructed falls through to the older object instead of ReadQuorumNotMet.
High turmoil-tcp-cluster always ran 4 nodes with W=3, so a 3x2 report was a different cluster. A below-quorum put was left in place and the next read was skipped. hold/release did not overlap an RPC. turmoil::bounce is not a free function in turmoil 0.7 and was never called. Node count follows the topology; quorum is nodes/2+1. Failed puts roll back and the following read must still see the previous value. Holds cover the RPC. Sim::bounce runs between steps; durable state is outside the restarted host. 4x4 and 3x2 traces now differ.
Medium UploadPart below write quorum left shards in place. CompleteMultipartUpload reconstructed from the first data_shards replies, so a retry could mix two part attempts. Each attempt has an etag. Failure deletes only that etag. Complete requires one etag at write quorum.
Medium SimClock::sleep could miss advance if notify_waiters ran before notified() was polled. Register interest with enable() before inserting the waiter, and re-check the deadline under the lock.
Medium is_madsim_active() returned cfg!(feature = "madsim-compat"). That feature is empty and does not turn madsim on. Returns cfg!(madsim), with check-cfg so the expected cfg is declared.
Low Rayon campaigns append Antithesis JSONL from many registries with no lock, so lines can tear. Process-wide append lock.
Low Buggify stage-2 used one RNG for every site, so adding a site shifted later sites. Per-site SimRng::fork.
Low A pre-write metadata read that missed read quorum was reported as WriteQuorumNotMet. ReadQuorumNotMet with the read threshold.
Coverage Chaos never deleted. If-None-Match: * was not checked against a delete marker. Wall-clock leases were never shown to expire under skew. Chaos issues deletes (indeterminate deletes are legal NotFounds). Erasure scenario recreates over a delete marker. Lock scenario keeps a negative wall-clock control.

Intentionally left alone

  • Cauchy GF(2^8) vs production rs-vandermonde, and SHA-256 vs per-block HighwayHash. This crate is a behavioral simulator. The README already says Cauchy. Swapping in the on-disk codec would not change the quorum or crash invariants exercised here, and it is not byte-compatible with xl.meta.
  • CRC32 shard distribution. FileInfo::new hashes the object string; distribution_start hashes bucket + "/" + object. Identity placement is still a permutation of 1..=N, and these tests decide by shard index stored in metadata, not by which drive is index 0. Copying one of the two upstream formulas would not be a faithful hook.
  • Delete-marker quorum N/2+1 in docs/architecture/erasure-coding.md. On current main, MetadataQuorumAccumulator::early_stop_decision accepts a delete marker at default_write_quorum(), not at majority. DST follows that code. Using majority would disagree with GET early-stop (for 4x4, 9 vs 12).
  • Object Lock, version stacks, IAM, and S3 ETag/If-Match byte layout. Not part of the invariants this harness claims to enforce. If-Match stays the payload SHA-256 stand-in already in PutConditions.
  • Failing a short campaign when a sometimes probe was never hit. That gate is probabilistic and would flake CI. The new tests force the delete, fallback, part-rollback, and turmoil paths directly.

Verification

  • cargo fmt --all -- --check
  • cargo clippy --workspace --all-targets -- -D warnings
  • cargo test --workspace (includes 25-seed swizzle-clog on 4x4 and 3x2, and every scenario on 4x4 / 3x2 / 4x2)
  • cargo run -p rustfs-dst-cli -- verify-determinism for 4x4, 3x2, and 4x2 at seed 2026
  • CI's release 50-seed campaign was not run in this environment. Debug tests above cover the same scenarios, including the chaos seeds that now delete.

Related Issues

None.

Open in Web Open in Cursor 

The simulated disk treated fsync_file as publishing directory entries and
fsync_dir as flushing dirty file bytes, so crash tests could pass without
the barriers RustFS actually needs. Delete markers were visible at read
quorum, the turmoil TCP scenario ignored topology and could publish a
failed write, and a few reproducibility hooks were wrong.

Align those checks with current RustFS quorum rules and add regressions.

Co-authored-by: RustFS <hello@rustfs.com>
* Validate DST object visibility and seed campaigns

* Keep acknowledged multipart parts across failed retries
@loverustfs
loverustfs merged commit 250229b into main Nov 28, 2026
1 check 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.

2 participants