Return HTTP 410 for undelete on permanently deleted blob#3236
Draft
rcshaw wants to merge 1 commit intolinkedin:masterfrom
Draft
Return HTTP 410 for undelete on permanently deleted blob#3236rcshaw wants to merge 1 commit intolinkedin:masterfrom
rcshaw wants to merge 1 commit intolinkedin:masterfrom
Conversation
Add a case for BlobDeletedPermanently in UndeleteOperation.processServerError, mapping it to RouterErrorCode.BlobDeleted (HTTP 410 Gone).
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3236 +/- ##
=============================================
- Coverage 64.24% 52.25% -11.99%
+ Complexity 10398 8911 -1487
=============================================
Files 840 931 +91
Lines 71755 82074 +10319
Branches 8611 10436 +1825
=============================================
- Hits 46099 42889 -3210
- Misses 23004 35809 +12805
- Partials 2652 3376 +724 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
|
Bouncing to retrigger CI on the new base (snalli/clustermap-test-flakes). |
Contributor
|
Reopened — CI should now run with the parallelized unit-test matrix + clustermap deflake fixes inherited from the new base. |
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.
Summary
Add a case for BlobDeletedPermanently in UndeleteOperation.processServerError, mapping it to RouterErrorCode.BlobDeleted so the frontend returns HTTP 410 Gone. Previously this server error code had no case in the switch and fell through to the default UnexpectedInternalError, surfacing as HTTP 500. A 410 (or any 4xx) is the correct semantic since the blob has been compacted and the undelete request can never succeed; clients should not retry.
Testing Done
Added blobDeletedPermanentlyTest in UndeleteManagerTest. Tests pass
./gradlew :ambry-router:test --tests "com.github.ambry.router.UndeleteManagerTest"