Return 5xx instead of 404 when named blob metadata exists but storage replicas return NOT_FOUND#3234
Draft
abha-mutalik wants to merge 2 commits intolinkedin:masterfrom
Draft
Conversation
…ts but storage replicas return NOT_FOUND When a named blob's metadata is resolved successfully via idConverter but the storage layer subsequently returns BlobNotFound on every replica, NonBlockingRouter now translates the resolved error from RouterErrorCode.BlobDoesNotExist to RouterErrorCode.AmbryUnavailable. This surfaces as HTTP 503 (retryable) rather than HTTP 404 (authoritative), since the metadata says the blob exists and a missing storage response is therefore transient (replication lag, in-flight delete race, or replica outage). - Wrap callback in getBlob(RestRequest, ...) to apply translation only after idConverter.convert() succeeded. - Add namedBlobMetadataExistsButStorageNotFoundCount counter for visibility into how often this inconsistency occurs. - Fix pre-existing operations-counter underflow in the same method's idConverter-failure branch (no matching increment). - Add parameterized tests for both the translation and the metadata-not-found regression case. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3234 +/- ##
=============================================
- Coverage 64.24% 51.25% -12.99%
+ Complexity 10398 8666 -1732
=============================================
Files 840 931 +91
Lines 71755 79406 +7651
Branches 8611 9500 +889
=============================================
- Hits 46099 40701 -5398
- Misses 23004 35330 +12326
- Partials 2652 3375 +723 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
…tFoundCache test - Document the named-blob translation contract on the Router.getBlob(RestRequest, ...) interface so downstream Router implementations are aware that BlobDoesNotExist may be translated to AmbryUnavailable after a successful IdConverter resolution. - Soften the translated RouterException message: drop "treating as transient" (which can read as false reassurance in logs) and replace with a factual "Named blob metadata exists but storage returned BlobNotFound for the resolved blob ID." - Add a parameterized test covering the notFoundCache short-circuit path. getBlobHelper completes that path through completeOperation(...) rather than BlobOperationCallbackWrapper, and the wrapped callback must still translate BlobDoesNotExist to AmbryUnavailable when metadata exists. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
When a named blob's metadata is resolved successfully via idConverter but the storage layer subsequently returns BlobNotFound on every replica, NonBlockingRouter now translates the resolved error from RouterErrorCode.BlobDoesNotExist to RouterErrorCode.AmbryUnavailable. This surfaces as HTTP 503 (retryable) rather than HTTP 404 (authoritative), since the metadata says the blob exists and a missing storage response is therefore transient (replication lag, in-flight delete race, or replica outage).
Summary
Testing Done