Skip to content

Wire single-object named DELETE to bounded retirement - #3320

Open
jitheshtr wants to merge 4 commits into
linkedin:masterfrom
jitheshtr:jirajan/wire-named-retirement-delete
Open

jitheshtr wants to merge 4 commits into
linkedin:masterfrom
jitheshtr:jirajan/wire-named-retirement-delete

Conversation

@jitheshtr

@jitheshtr jitheshtr commented Dec 1, 2026 •

Copy link
Copy Markdown
Contributor
Order PR Status Runtime effect
1 Transaction executor ✅ Merged Preserves known transaction outcomes.
2 Exact-version manifests ✅ Merged Stores manifests and fences atomically.
3a Migration safety ✅ Merged Verifies migration safeguards.
3b Retirement-aware serving ✅ Merged Gates fence-aware GET, LIST and PUT.
3c Bounded retirement Open Adds the exact-intent publication handle.
— Legacy DELETE test ✅ Merged Makes the legacy DELETE ordering fixture deterministic; no runtime effect.
4 (you are here) Single-object named DELETE Open Adds the default-off frontend caller.
5 Fail-closed pause Open Rejects selected named DELETEs without falling back to physical DELETE.
6 Planned-stop drain Open Adds a pre-stop operation; no rollout wiring or config changes.

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 versionId deletes 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 409 after rollback; an unknown publication outcome remains 503 unless the exact receipt confirms it. An unreadable root returns 503 without 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

  • Local code review completed
  • ./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

@codecov-commenter

codecov-commenter commented Dec 1, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 4.72973% with 423 lines in your changes missing coverage. Please review.
✅ Project coverage is 37.62%. Comparing base (52ba813) to head (f774da3).
⚠️ Report is 435 commits behind head on master.

Files with missing lines Patch % Lines
.../java/com/github/ambry/named/MySqlNamedBlobDb.java 0.00% 155 Missing ⚠️
...com/github/ambry/named/NamedBlobManifestStore.java 0.00% 94 Missing ⚠️
...hub/ambry/frontend/NamedBlobRetirementHandler.java 0.00% 77 Missing ⚠️
...java/com/github/ambry/router/GetBlobOperation.java 42.85% 13 Missing and 3 partials ⚠️
...a/com/github/ambry/frontend/DeleteBlobHandler.java 0.00% 14 Missing ⚠️
...hub/ambry/frontend/FrontendRestRequestService.java 0.00% 14 Missing ⚠️
...n/java/com/github/ambry/router/GetBlobOptions.java 26.66% 9 Missing and 2 partials ⚠️
...thub/ambry/messageformat/MetadataContentSerDe.java 9.09% 9 Missing and 1 partial ⚠️
.../src/main/java/com/github/ambry/named/Metrics.java 0.00% 10 Missing ⚠️
...ithub/ambry/messageformat/MessageFormatRecord.java 18.18% 8 Missing and 1 partial ⚠️
... and 6 more

❗ There is a different number of reports uploaded between BASE (52ba813) and HEAD (f774da3). Click for more details.

HEAD has 1 upload less than BASE
Flag BASE (52ba813) HEAD (f774da3)
3 2
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.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

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>
@jitheshtr
jitheshtr force-pushed the jirajan/wire-named-retirement-delete branch from 8ce92f6 to 51f11ab Compare December 3, 2026 01:33
}
StoreKey key = keyFactory.getStoreKey(Base64.getUrlEncoder().withoutPadding().encodeToString(bytes));
if (!(key instanceof BlobId) || !Arrays.equals(bytes, key.toBytes())
|| !isCompositeRoot((BlobId) key, account, container)) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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,

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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);

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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?

jitheshtr and others added 3 commits December 3, 2026 14:43
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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants