Close the OLC validation and ordering holes gating the WorkTable write mutex - #3
Merged
Merged
Conversation
added 15 commits
August 31, 2026 22:46
The workflow still targeted main after the default branch moved to master, so no run has ever executed on this repository, and the jobs sat on ubuntu-latest against the house rule that every repository uses ubicloud-standard-N runners.
The gh-pages auto-push ran on pull requests too, where the default token has no write permission, failing the job after the benchmark itself had passed. Pull requests keep the benchmark and the regression alert; only push builds publish the chart, with the write permission the job actually needs.
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.
Fixes the five reader-vs-writer holes found by the 2026-08-31 WorkTable audit. These are the items gating removal of WorkTable's global write mutex (the 0.4.1 visibility-bug workaround, whose underlying bug 0.4.2 already fixed).
Fixes
scan()returnedOk(0)(authoritative empty range) withoutcheck_versionwhenget_childmissed, so a scan racing a same-node insert (whosecopy_withinshifts the key array mid-read) reported empty while committed keys existed. The miss path now validates like the hit path.KeyTracker::append_prefixre-validates the child version after reading its prefix, and every successful return inscan()/find_start()/find_end()/copy_node_recursive()re-validates the node, closing the torn-prefix window on the last-processed child.KeyTracker::pushis fallible — overflow (only reachable via torn reads) maps toVersionNotMatchand feeds the existing retry loops instead of aborting the process (release profile is panic=abort).upgradeCAS success orderings Release → AcqRel (lock acquisition needs Acquire), andcheck_versiongets an Acquire fence before its load so preceding data loads cannot sink below the re-validation. One-line rationale comments at each site.NodePtr::from_payloaddebug-asserts the high bit;CongeeRaw::insertdocuments that values must stay below 2^63. Plus: range-scan docs corrected to end-exclusive[start, end)(the implementation is authoritative; the inclusive doc comments were wrong), and the Arc wrapper'scompute_*no longer leaks one refcount per contention retry.Verification
test_scan_racing_same_node_insert: 100k native rounds; catches fix 1 when it is reverted (3/5 runs), which is the teeth check. Also wrapped for shuttle and added to CI.--all-features -D warnings, fmt, and all four shuttle CI targets in release.copy_withintear (it only preempts at instrumented atomics) and models everything as SeqCst, so the native stress is the net for fix 1 and the ordering fixes in commit 4 are correct by construction rather than shuttle-validated.Known issues documented for the next audit (not fixed here)
stats()/to_compact_set()unwrap read locks and abort under a concurrent writer;to_compact_set()has an empty-node underflow and i16 offset truncation; remove never shrinks/merges nodes (memory ratchets under churn); retry loops spin without parking; no resumable scan cursor (consumers should key-page).For WorkTable
After this merges and publishes, WorkTable can drop its global write mutex around congee mutations (
src/index/congee.rs), and its range adapter should switch to key-paging.