Repository navigation
fix: stop reaps the bucket pass; dry PUT writes atomically - #84
Merged
Merged
Conversation
Two flaky members checks, two races. CK-02 swept a young tombstone. serve's stop ended the prune loop with pkill -P, which reaches the prune --loop bash but not its bucket subshell, so a reconcile pass kept running after stop returned and its row 5 deleted the next step's own-origin tombstones. This is a product bug: a service-less start leaves a bucket writer alive after stop. The loop and prune --loop now run their child as a job and wait on it under a TERM trap that kills and reaps it, so stop returns only after the pass is gone. CC-14 (add-first) lost the add's lease. The dry bucket's PUT wrote the object in place with cp, so the setup's lease poll could read a torn lock/admin, judge it unreadable and stale, and take it over with an If-Match on the etag of the finished write. The dry PUT now writes a dot-named temp and renames it, as atomic as an R2 PUT. Test seam only.
A 10x loaded loop of both sections is green, and a negative control that widens each race goes red on the pre-fix CLI with the CI signatures.
macOS /bin/bash 3.2 treats an unset $! as unbound under set -u even in
the ${!:-} form, so the traps turn set -u off before they read $!.
The negative control names the pre-fix base 9c2179c and carries its widening diff; the green loop reruns at the bash 3.2 trap form; the origin prune gap and the wide run are listed as not proven.
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.
What
Two flaky members checks were real races, visible since the suite stopped hiding members failures.
stopkilled the prune loop but not its( r2_prune; r2_reconcile )subshell, so a bucket pass ran on afterstopand deleted a tombstone. Product bug on member machines; the origin's hourly pass had the same gap. Both now run as a job under a TERM trap that kills and reaps it.lock/adminand took the lease over. The dry PUT now writes a temp file and renames it. Test seam only.CLAUDE.md gains the trap lesson.
Demo
No user-visible change;
stopnow returns only after the bucket pass is gone.Proof
docs/verification/members-flaky-checks.md: 10 of 10 loaded runs green; both races reproduced red on the pre-fix CLI.
Bookkeeping
Tests run: filtered sections (members, tenant, r2, prune), bash 3.2 parse, shellcheck.