Skip to content

Persist exact-version manifests for recoverable named soft deletes - #3313

Merged
jitheshtr merged 5 commits into
linkedin:masterfrom
jitheshtr:jirajan/recoverable-named-delete
Dec 1, 2026
Merged

jitheshtr merged 5 commits into
linkedin:masterfrom
jitheshtr:jirajan/recoverable-named-delete

Conversation

@jitheshtr

@jitheshtr jitheshtr commented Nov 24, 2026 •

Copy link
Copy Markdown
Contributor
Order PR Status Runtime effect
1 Transaction executor ✅ Merged Preserves known transaction outcomes.
2 (you are here) Exact-version manifests Open Adds the store; no frontend caller.
3a Migration safety Open Runbook and integration coverage.
3b Retirement-aware reads Open Gated GET, LIST and PUT changes.
3c Bounded retirement Draft Adds an exact-retry handle; no frontend caller.

Summary

  1. Keep the ordered chunk IDs for each exact named version in one MySQL row. The key is (account_id, container_id, blob_name, version); recovery does not require the original Ambry root.
  2. Publish the exact manifest set and retire the named versions in one transaction. Retry an uncertain outcome with the original inputs, not the current contents of the name.
  3. Keep the public DELETE path and worker out of this PR. A recovered chunk ID is not proof of exclusive ownership.

Durability and rollout: Defer production DDL. Once installed, every named PUT checks the manifest table and depends on the trigger definer, even before DELETE activation. A publication admits at most 32 unfenced versions and 262,144 children in total; every live version must have a matching composite manifest. Before activation, qualify packet limits and replication on writers and promotion candidates, gate legacy DELETE and purge, deploy retirement-aware reads, and provide durable worker discovery and an ownership policy. On rollback, disable publication but keep the fences and committed evidence. See the migration runbook.

Testing Done

./gradlew --offline --no-daemon --max-workers=2 -q :ambry-named-mysql:test --tests '*MySqlNamedBlobDbTest' --tests '*NamedBlobManifestStoreTest' :ambry-named-mysql:intTest --tests '*NamedBlobManifestStoreIntegrationTest' (private project cache): 27 unit and 19 integration cases passed, none skipped, including a one-row round trip of 262,144 ordered 127-byte V5 chunk IDs (32 MiB).

Local sizing probe (Connector/J 8.0.21, MySQL 8.0.46): two synthetic 32 MiB descriptor bodies round-tripped byte-for-byte in both prepared-statement modes with a 128 MiB packet limit. At 64 MiB, server-prepared worked and client-prepared rejected the request. With a 1 MiB client limit both modes rejected the write, and a fresh connection confirmed the test transaction's marker rolled back. Production and replication limits have not been verified.

  • Local code review completed

Generated with GitHub Copilot CLI

@codecov-commenter

codecov-commenter commented Nov 24, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 78.87324% with 60 lines in your changes missing coverage. Please review.
✅ Project coverage is 50.85%. Comparing base (52ba813) to head (3a5e421).
⚠️ Report is 429 commits behind head on master.

Files with missing lines Patch % Lines
...com/github/ambry/named/NamedBlobManifestStore.java 80.98% 19 Missing and 31 partials ⚠️
.../java/com/github/ambry/named/MySqlNamedBlobDb.java 52.38% 7 Missing and 3 partials ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             master    #3313       +/-   ##
=============================================
- Coverage     64.24%   50.85%   -13.39%     
+ Complexity    10398     8799     -1599     
=============================================
  Files           840      941      +101     
  Lines         71755    81285     +9530     
  Branches       8611     9853     +1242     
=============================================
- Hits          46099    41338     -4761     
- Misses        23004    36489    +13485     
- Partials       2652     3458      +806     

☔ 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.

@jitheshtr
jitheshtr marked this pull request as ready for review November 24, 2026 23:30
@jitheshtr
jitheshtr force-pushed the jirajan/recoverable-named-delete branch from 6cb6511 to ca6012d Compare November 25, 2026 02:55
Stage ordered child IDs for each immutable root. Publish the exact manifest set and soft-retire its named versions in one transaction, so a retry does not resolve a replacement name. Published pages can be read by manifest ID without fetching the root.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@beijxu

beijxu commented Nov 26, 2026

Copy link
Copy Markdown
Contributor

Please store the full ordered list of chunk IDs in one MySQL row per named version, without splitting it into 64-ID pages. Follow the stitch path on master, which stores the full list in one payload. Keep the MySQL copy independent of the original root, and publish it in the same transaction that retires the exact named version. Verify that the largest supported payload fits the MySQL column and request limits. Add paging only if a concrete limit requires it.

@beijxu

beijxu commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Please use (account_id, container_id, blob_name, version) as the primary key for the manifest, just as named_blobs_v2 identifies the original named blob version. Store the full ordered chunk list in one row for that tuple instead of generating a separate UUID. This PR already enforces uniqueness on the tuple, and without page rows there is no need for a shorter join key.

The cleanup worker can save the exact tuple and read the manifest directly, without resolving the latest version or reading the original Ambry root. Keep root_id in the row to detect conflicts. Do not reuse the tuple for a different root while a manifest or cleanup job still refers to it. Publish the manifest in the same MySQL transaction that retires that version.

jitheshtr and others added 4 commits November 27, 2026 09:54
Use the named version tuple for recovery and reserve it against root substitution. Validate bounded payload size, transaction rollback, locking and restart recovery on MySQL.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Eliminate durable staging. Bound request size before reading chunk iterators and use exact version-set receipts for lost commit replies. Reject reinsertions of published tuples even when the root matches.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
… on missing manifests

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@jitheshtr
jitheshtr merged commit 5f58830 into linkedin:master Dec 1, 2026
11 checks passed
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