Repository navigation
Fix DST durability, quorum visibility, and turmoil false confidence - #5
Merged
Merged
Conversation
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>
6 tasks done
* Validate DST object visibility and seed campaigns * Keep acknowledged multipart parts across failed retries
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Audit of this DST framework against current
rustfs/rustfsmain(erasure-coding spec,MetadataQuorumAccumulator,FileInfodistribution) 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
SimDiskIomade a new file durable onfsync_filealone (ensure_parentsinserted it into the durable image) andfsync_dircopied dirty file bytes. Crash tests could pass when a rename or datafsyncwas missing.fsync_filepersists bytes only;fsync_dirpersists names and does not flush dirty data.fsync_diralso 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.3x2/4x2, GET treated a delete marker as authoritative at read quorum (data_shards). RustFS early-stop accepts a delete marker only atdefault_write_quorum()(data+1when data == parity). Three of six delete markers hid a live object, and heal then copied that marker onto every drive.ReadQuorumNotMet.turmoil-tcp-clusteralways ran 4 nodes with W=3, so a3x2report was a different cluster. A below-quorum put was left in place and the next read was skipped.hold/releasedid not overlap an RPC.turmoil::bounceis not a free function in turmoil 0.7 and was never called.nodes/2+1. Failed puts roll back and the following read must still see the previous value. Holds cover the RPC.Sim::bounceruns between steps; durable state is outside the restarted host.4x4and3x2traces now differ.UploadPartbelow write quorum left shards in place.CompleteMultipartUploadreconstructed from the firstdata_shardsreplies, so a retry could mix two part attempts.SimClock::sleepcould missadvanceifnotify_waitersran beforenotified()was polled.enable()before inserting the waiter, and re-check the deadline under the lock.is_madsim_active()returnedcfg!(feature = "madsim-compat"). That feature is empty and does not turn madsim on.cfg!(madsim), withcheck-cfgso the expected cfg is declared.SimRng::fork.WriteQuorumNotMet.ReadQuorumNotMetwith the read threshold.If-None-Match: *was not checked against a delete marker. Wall-clock leases were never shown to expire under skew.NotFounds). Erasure scenario recreates over a delete marker. Lock scenario keeps a negative wall-clock control.Intentionally left alone
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 withxl.meta.FileInfo::newhashes the object string;distribution_starthashesbucket + "/" + object. Identity placement is still a permutation of1..=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.N/2+1indocs/architecture/erasure-coding.md. On currentmain,MetadataQuorumAccumulator::early_stop_decisionaccepts a delete marker atdefault_write_quorum(), not at majority. DST follows that code. Using majority would disagree with GET early-stop (for4x4, 9 vs 12).If-Matchbyte layout. Not part of the invariants this harness claims to enforce.If-Matchstays the payload SHA-256 stand-in already inPutConditions.sometimesprobe 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 -- --checkcargo clippy --workspace --all-targets -- -D warningscargo test --workspace(includes 25-seed swizzle-clog on4x4and3x2, and every scenario on4x4/3x2/4x2)cargo run -p rustfs-dst-cli -- verify-determinismfor4x4,3x2, and4x2at seed 2026Related Issues
None.