Repository navigation
fix: fail closed on unreadable legacy tombstones - #247
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>
perfloop
Bot
force-pushed
the
perfloop-pr-open-2ma3ywfrew
branch
from
October 3, 2026 04:41
0127bf7 to
369a1a8
Compare
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 failed legacy tombstone read no longer authorizes a metadata write. This prevents old multipart metadata from resurfacing after a newer same-key completion while keeping metadata warming best-effort and successful S3 responses unchanged.
tombstoneTimestampdistinguishes a genuinely absent marker from cache read or routing errors and malformed marker lengths.putMetarefuses the visibility write and recordsmeta_put/errorwhen marker state is unknown. A truly absent marker still permits a warm, and an ordered write with a stale token is still blocked by a newer tombstone.TestLegacyCoordinator_TombstoneReadErrorAndMalformedMarkerRefuseMetaWritecovers read/routing errors and malformed markers;TestLegacyCoordinator_TombstoneAbsenceStillAllowsMetaWarmcovers genuine absence;TestLegacyCoordinator_TombstoneBlocksStalePopulatecovers a valid newer tombstone.TestCompleteMultipart_TombstoneReadFailureDoesNotResurrectOldMetadataholds the first completion'sv1HEAD while a second same-key completion returnsv2, then fails only the first warm's tombstone read and checks stored metadata, HEAD, and conditional GET.docs/metrics.mdnow includes CASPutIfVersionversion mismatches inmeta_put/precondition_lost, alongside the legacy missing-token and newer-tombstone causes. Unreadable or malformed legacy markers remainerror. The configuration docs and README describe the fail-closed behavior.The controlled in-memory cache and forwarder establish this injected ordering, not its frequency in production. The assertion covers stale metadata and ETags, not old object bytes from missing blocks. The second metadata warm can remain coalesced behind the first worker, so the newer object may require an upstream miss rather than an immediate cache hit.
Tests:
make lint-ci,make build,make test,make test-integration,make test-race, andmake test-coveragepassed. The regression tests named above exercise the marker errors, absence behavior, valid-tombstone guard, and multipart schedule.The repair assertion was violated at
c69532431456d12d853300d524043787e8d649aaand satisfied on the final source.bash -c "set -eu\nassertion='With cache and block caching enabled in default legacy coordination, a failed tombstone read during a held pre-overwrite metadata warm must not publish or return the old ETag through HEAD or If-None-Match GET after a newer same-key multipart completion succeeds.'\nresult=\"${TMPDIR}/tombstone-result.$$\"\nnative_log=\"${TMPDIR}/tombstone-native-output.$$\"\nrm -f \"$result\" \"$native_log\"\nset +e\nPERFLOOP_ASSERTION_RESULT_FILE=\"$result\" \"$PERFLOOP_BUILD_OUTPUT_DIR/proxy.test\" -test.run '^TestCompleteMultipart_TombstoneReadFailureDoesNotResurrectOldMetadata$' -test.count=1 -test.timeout=30s >\"$native_log\" 2>&1\ntest_status=$?\nset -e\nif [ -f \"$native_log\" ]; then\n cat \"$native_log\" >&2\nfi\noutcome=$(cat \"$result\" 2>/dev/null || true)\nrm -f \"$result\" \"$native_log\"\nif [ \"$outcome\" = \"violated\" ] && [ \"$test_status\" -ne 0 ]; then\n printf '{\"assertion\":\"%s\",\"outcome\":\"violated\"}\\n' \"$assertion\"\nelif [ \"$outcome\" = \"satisfied\" ] && [ \"$test_status\" -eq 0 ]; then\n printf '{\"assertion\":\"%s\",\"outcome\":\"satisfied\"}\\n' \"$assertion\"\nelse\n printf 'native test result incomplete: status=%s outcome=%s\\n' \"$test_status\" \"$outcome\" >&2\n printf '{\"assertion\":\"%s\",\"outcome\":\"inconclusive\"}\\n' \"$assertion\"\nfi\nexit 0"Recorded proof ran with retained support that is not included in this pull request.
Other target-CI checks: S3 Compatibility Tests / s3-compat-tests (default), S3 Compatibility Tests / s3-compat-tests (tiered), S3 Compatibility Tests (Cluster) / s3-compat-tests-cluster (default), Lint PR Title / lint, and CLA Assistant / cla.
Generated by Perfloop. Measurements and checks. Reproduce this comparison (tenant access required).
Note
Medium Risk
Changes cache metadata ordering on tombstone read failures, reducing stale-metadata exposure but possibly skipping best-effort warms under transient cache errors; S3 write responses are unchanged.
Overview
Legacy cache coordination now fails closed when invalidation tombstones cannot be trusted. Ordered metadata writes (
PutMetaIfVersion) used to treat tombstone read failures like “no tombstone,” which could let a slow meta-on-write publish stale ETags after a newer same-key write.tombstoneTimestampnow returns an error for backend/routing failures and non–8-byte markers; only genuine absence (NotFound/ nil data) still allows a warm.putMetapropagates those errors and incrementsmeta_put/errorinstead of committing metadata.Regression tests cover coordinator refusal paths, absent-marker success, and a multipart meta-on-write race where the first worker’s tombstone read fails after a second completion. README, configuration, and metrics docs describe the behavior and label semantics.
Reviewed by Cursor Bugbot for commit 369a1a8. Bugbot is set up for automated code reviews on this repo. Configure here.