Skip to content

Don't delete a committed log segment when the manifest CAS answers 412 - #14

Closed
dumontg wants to merge 1 commit into
imports/07-azure-upstreamfrom
imports/08-cas-412
Closed

dumontg wants to merge 1 commit into
imports/07-azure-upstreamfrom
imports/08-cas-412

Conversation

@dumontg

@dumontg dumontg commented Oct 7, 2026

Copy link
Copy Markdown
Owner

Stacked on #13.

Imports tobi/walgit#103 by @0bserver07, unchanged. A manifest CAS that landed but whose reply was lost, then retried, answers 412 from the write that already committed; the publisher treated that as a lost race and deleted a log segment the committed manifest lists. It now checks before deleting.

Verified on the top of this stack: cargo clippy --workspace --all-targets -- -D warnings, cargo fmt --check, the crate test suites, and the Azure harness (just test-azure: store contract plus git push, clone, pull and cold restart on Azurite) pass. Known unrelated failures: the runtime stall timing tests in e2e (also intermittent on main) and the web UI asset tests that need pnpm run build.

The S3 SDK retries failed calls three times by default and the GCS
client retries uploads that carry a precondition, the manifest CAS
included. When a CAS lands and its reply is lost, the retry gets a 412
from our own write. process_batch, publish_compact_classified and
publish_settings_impl all read any 412 as a lost race and delete their
log segment, which the committed manifest now lists: the writer reports
a failure for a durable change and every reader then fails on the
missing segment.

Run the existing cas_landed check on a 412 too before dropping the
segment, and keep an unknown outcome unknown when that check fails.
The fault store gains the missing fault kind (applied, then 412),
sharing the existing CAS roll so seeded simulations keep their
sequences, and a test drives a push, a compaction and a settings change
through it. One extra manifest GET on the 412 path only.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 9fb0223)
@dumontg

dumontg commented Oct 7, 2026

Copy link
Copy Markdown
Owner Author

Landed on main in 8347913 (merge of the stack top 59b206f), so this PR's changes are on main.

@dumontg dumontg closed this Oct 7, 2026
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