Skip to content

fix: fail closed on unreadable legacy tombstones - #247

Merged
ovaistariq merged 4 commits into
mainfrom
perfloop-pr-open-2ma3ywfrew
Oct 21, 2026
Merged

ovaistariq merged 4 commits into
mainfrom
perfloop-pr-open-2ma3ywfrew

Conversation

@perfloop

@perfloop perfloop Bot commented Oct 3, 2026 •

Copy link
Copy Markdown
Contributor

In default legacy coordination, ordered metadata writes now fail closed when the tombstone read fails or its value is malformed. A genuinely absent marker still permits a warm, and a newer valid tombstone still blocks a stale token. The detached metadata warm remains best-effort, so refusing it does not change a successful multipart response.

TestLegacyCoordinator_TombstoneReadErrorAndMalformedMarkerRefuseMetaWrite covers backend/routing failures and malformed marker lengths. TestLegacyCoordinator_TombstoneAbsenceStillAllowsMetaWarm checks genuine absence; TestLegacyCoordinator_TombstoneBlocksStalePopulate covers the valid newer-tombstone guard. TestCompleteMultipart_TombstoneReadFailureDoesNotResurrectOldMetadata holds the first completion's v1 HEAD while a second same-key completion returns v2, then fails only the first warm's tombstone read. It checks stored metadata, HEAD, conditional GET, and both completion responses.

This condition holds with this change and does not hold at 50146c6b2f0360a36caa7809a767d8c09b4c5a55: 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..

The comparison schedule uses a controlled in-memory cache and forwarder harness retained outside this pull request. It proves this injected ordering, not how often it occurs in production; that frequency remains unmeasured. The finding concerns stale metadata and ETags, not old object bytes from missing blocks. The second metadata warm can still be coalesced, so the newer object may require an upstream miss rather than an immediate cache hit.

docs/metrics.md documents CAS PutIfVersion mismatches as meta_put/precondition_lost; unreadable or malformed legacy markers remain meta_put/error. The README and configuration docs describe the fail-closed behavior.

Passed checks: make lint-ci, make build, make test, make test-integration, make test-race, and make test-coverage.


Generated by Perfloop.

@greptile-apps

greptile-apps Bot commented Oct 3, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no blocking issues were found.

Summary

Legacy ordered metadata writes now stop when a tombstone read fails or its stored length is wrong.

  • Legacy metadata warms stop when tombstone state is unknown.

Reviews (4) · Last reviewed commit: "Merge branch 'main' into perfloop-pr-ope..." · Reviewed by Greptile

Comment thread cache/coordinator.go Resolved
Comment thread docs/metrics.md Resolved
@perfloop
perfloop Bot force-pushed the perfloop-pr-open-2ma3ywfrew branch from 0127bf7 to 369a1a8 Compare October 3, 2026 04:41
@ovaistariq
ovaistariq merged commit 66cde01 into main Oct 21, 2026
10 checks passed
@ovaistariq
ovaistariq deleted the perfloop-pr-open-2ma3ywfrew branch October 21, 2026 18:58
@github-actions github-actions Bot locked and limited conversation to collaborators Oct 21, 2026
@tigrisdata-argocd-bot

Copy link
Copy Markdown

🎉 This PR is included in version 1.22.3 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants