Repository navigation
fix: fence stale tiered re-tier metadata writes - #253
Open
perfloop[bot] wants to merge 3 commits into
Open
perfloop[bot] wants to merge 3 commits into
perfloop[bot] wants to merge 3 commits into
Conversation
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
Signed-off-by: Perfloop Agent <agent@perfloop.ai>
|
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.
A delayed tiered GET could register its background re-tier after a successful local PUT and use the PUT's newer metadata version to remove or relabel the entry. The worker now carries the marker version observed by the GET, refuses a pre-fetch mismatch, and uses that original version for every metadata mutation. This keeps local writes authoritative while unchanged markers continue to heal and converge. The README and tiered-mode guide now describe this guarantee. This is a source-derived race, not an observed production incident.
The original-defect test is
TestTieredRetierDelayedRegistrationPreservesLocalPut; its two schedules cover a 404 and a different-ETag 200, including a same-content successor PUT. The preservation test isTestTieredRetier404ConvergesUnchangedMarker. Existing tests cover healing, replacement convergence, cancellation, and the held-write claim.make lint-ci,make build,make test, andmake test-racepassed locally.The tiered S3 compatibility profile was not run here:
make s3-test-local-tieredandS3TEST_PROFILE=tiered make s3-testsrequire Tigris credentials for a live upstream.The production frequency of this source-derived race is unmeasured.
satisfied
violated
25edfad56c72d7a7bc56daab8dac642c45faaa03Generated by Perfloop.
Note
Medium Risk
Changes authoritative tiered metadata CAS behavior for background re-tier; correctness fix with targeted tests, but races in tiered mode are sensitive.
Overview
Fixes a tiered-mode race where a delayed background re-tier could register after a successful local PUT and mutate metadata using a newer version token—removing or relabeling the local write.
Re-tier-on-read now carries the marker version from the triggering GET into
maybeRetierOnRead. The worker checks that snapshot before upstream work and uses that same version for everyPutMetaIfVersion/DeleteMetaIfVersion, so stale heals cannot overwrite a later local PUT (including same-content MD5 ETag cases). Unchanged-marker 404 convergence is preserved.README and
docs/tiered-mode.mddocument the version-bound re-tier guarantee. Tests add a gated metadata client and scenarios for delayed registration plus unchanged-marker 404 convergence.Reviewed by Cursor Bugbot for commit 48f6083. Bugbot is set up for automated code reviews on this repo. Configure here.