Repository navigation
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #3320 +/- ##
=============================================
- Coverage 64.24% 37.62% -26.62%
+ Complexity 10398 6480 -3918
=============================================
Files 840 942 +102
Lines 71755 81673 +9918
Branches 8611 9945 +1334
=============================================
- Hits 46099 30733 -15366
- Misses 23004 48439 +25435
+ Partials 2652 2501 -151 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Include the bounded writer and gate native and S3 named DELETE by namespace and fence-aware serving. Read bounded root descriptors, publish the exact versions, and resolve a lost commit reply against the same receipt without invoking router DELETE. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
8ce92f6 to
51f11ab
Compare
| } | ||
| StoreKey key = keyFactory.getStoreKey(Base64.getUrlEncoder().withoutPadding().encodeToString(bytes)); | ||
| if (!(key instanceof BlobId) || !Arrays.equals(bytes, key.toBytes()) | ||
| || !isCompositeRoot((BlobId) key, account, container)) { |
There was a problem hiding this comment.
Only composite (METADATA) roots are accepted, and nothing falls back to the legacy DELETE. So in the configured namespace, DELETE of a simple blob (e.g. any S3 object smaller than the chunk size), or of a version that is still IN_PROGRESS, returns 409 and the name can never be deleted. Is the namespace guaranteed to hold only composite blobs? If not, could simple blobs go through the legacy path, or could the manifest allow zero children?
| } | ||
| } | ||
| // Storage absence does not prove that the name is absent (S3 maps NotFound to success). | ||
| throw new RestServiceException("Cannot read named retirement root", failure, |
There was a problem hiding this comment.
If the root is NotFound/Deleted/expired-and-compacted on the storage servers while the MySQL row is still READY (raw-ID delete, TTL + compaction, data loss), every DELETE of that name returns 503 and clients retry forever. Only an operator can fix it. When the router confirms the root is gone on all replicas, could we fence the row with an empty manifest, since there are no children left to track? Or at least add a metric/log so these cases can be found.
| private final Router router; | ||
| private final BlobIdFactory keyFactory; | ||
| private final QuotaManager quotaManager; | ||
| private final ThreadPoolExecutor worker = new ThreadPoolExecutor(1, 1, 0, TimeUnit.MILLISECONDS, |
There was a problem hiding this comment.
A single thread with a SynchronousQueue, plus Semaphore(1) in #3319, means one DELETE per frontend host; concurrent requests get 503 immediately. S3 clients deleting many objects in parallel will see mostly 503s. Is this acceptable for the target namespace's delete rate?
| worker.execute(() -> { | ||
| Exception failure = null; | ||
| try { | ||
| QuotaChargeCallback charge = QuotaUtils.buildQuotaChargeCallback(request, quotaManager, false); |
There was a problem hiding this comment.
There are no metrics on this path. For a durability-sensitive rollout, could we add counters/latency for: success, receipt-confirmed after a failed publish, unconfirmed (503), busy/rejected (503), unsupported (409), root unreadable (503), and child-limit exceeded?
| throw new RestServiceException("Named retirement was not confirmed", publishFailure, | ||
| RestServiceErrorCode.ServiceUnavailable); | ||
| } | ||
| } catch (SQLDataException unsupported) { |
There was a problem hiding this comment.
Status mapping is inconsistent: an unsupported range found by selectRoots (SQLDataException) returns 409, but the same kind of rejection found during publish() (range changed, unrequested live version, conflicting manifest) is wrapped as 503 "not confirmed". Should definite rejections from publish (e.g. SQLDataException with no ambiguity about the commit) map to 409 too, so clients don't retry them forever?
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> (cherry picked from commit f5b10bf)
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Summary
Wire native and S3 single-object named DELETE to bounded retirement for one configured account/container. The frontend authorizes the request, selects exact versions on the local writer, and reads only their root descriptors. It rejects batch, dataset, and S3
versionIddeletes and unsupported history in that namespace without falling back to the legacy path. The root read shares deserialization with existing chunk-ID reads; its negative-cache bypass is independent of the child limit applied before list decoding. The default configuration is unchanged.Durability: A successful response requires a known commit or a positive receipt for the original intent. A failed receipt check never resolves the name again or deletes a replacement. The path does not delete raw roots or children. Activation still requires a fail-closed way to pause publication, protection against automatic replay of ambiguous DELETEs, one authoritative writer, fence-aware serving and promotion, drained legacy DELETE and cleanup, and packet/load qualification. See the activation checklist.
When a namespace is configured, startup checks a local writer session and refuses to start if the writer is incompatible. The same checks still run per checkout. A definitive history conflict returns
409after rollback; an unknown publication outcome remains503unless the exact receipt confirms it. An unreadable root returns503without fencing the name. Outcome and busy metrics support qualifying the one-slot limit before rollout.Merge order: Land #3319 first, then apply only the DELETE layer to the updated base. The original DELETE-only diff isolates the initial wiring; the subsequent commits on this PR contain the review follow-ups.
Testing Done
./gradlew --offline --no-daemon :ambry-frontend:test --tests com.github.ambry.frontend.NamedBlobDeleteHandlerTest --tests com.github.ambry.frontend.S3BatchDeleteHandlerTest :ambry-frontend:intTest --tests com.github.ambry.frontend.S3NamedBlobRetirementIntegrationTest :ambry-named-mysql:intTest --tests com.github.ambry.named.NamedBlobManifestStoreIntegrationTest— passed 11 frontend unit tests, five S3 HTTP cases, and 44 isolated MySQL cases../gradlew --offline --no-daemon :ambry-named-mysql:intTest --tests 'com.github.ambry.named.NamedBlobManifestStoreIntegrationTest.testWiredRetirement*'— passed all four wiring cases after the descriptor-validation follow-up. No shared or production database was tested.Generated with GitHub Copilot CLI