[#12221] feat(iceberg): Add conditional table undrop - #12227
Open
nevzheng wants to merge 11 commits into
Open
Conversation
This was referenced Jul 27, 2026
Code Coverage Report
Files |
nevzheng
force-pushed
the
codex/iceberg-rest-delete-20-03-undrop
branch
3 times, most recently
from
July 28, 2026 03:09
7d521af to
fbf5c70
Compare
8 tasks
nevzheng
marked this pull request as ready for review
July 28, 2026 03:15
nevzheng
force-pushed
the
codex/iceberg-rest-delete-20-03-undrop
branch
from
July 28, 2026 03:45
fbf5c70 to
3a1c8a9
Compare
This was referenced Jul 28, 2026
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.
What changes were proposed in this pull request?
This is Stack 20 review unit 5 of 5 and depends on #12226.
Review the commits in order:
feat(iceberg): add conditional table undropPOST /management/v1/{prefix}/namespaces/{namespace}/tables/{table}/undrop.deletionIdin the request body and one strong deletion ETag inIf-Match; the ETag is a precondition, not an identifier.table_meta.deletion_idand verifies that it is still the requested D1.DELETED, unexpired, and not attached to a purge job.table_metarow, clears its deletion fields, consumes D1, and appends the ALTER change event.test(iceberg): cover undrop transaction boundariesUNDROP never creates a replacement table and never runs an Iceberg unregister/register saga. There is no persisted RESTORED receipt or audit table in this POC; a repeated request after restoration observes no active deletion target.
After this PR: the Stack 20 API lifecycle is complete for review: DELETE retains the original row,
deleted=truediscovers D1 and its ETag, and conditional UNDROP directly reactivates that exact table generation. Purge selection, jobs, and physical file cleanup remain a separate epic.Review order: #12222 → #12223 → #12225 → #12228 → #12229 → #12226 → #12227.
Incremental diff:
nevzheng/gravitino@codex/iceberg-rest-delete-20-02-deleted-table-reads...codex/iceberg-rest-delete-20-03-undrop
Why are the changes needed?
This provides generation-safe recovery with one short relational transaction and the same row-lock boundary that a future purge claimant will use.
Related: #12221
Does this PR introduce any user-facing change?
Yes. Authorized clients can restore an eligible deleted table using its deletion ID and current strong ETag. Malformed, missing, stale, conflicting, expired, and purge-boundary requests receive distinct sanitized errors.
How was this patch tested?
The full Stack 20 head passes the combined focused configuration, relational, cache, DELETE, deleted-read, authorization, ETag, UNDROP, rollback, retry, and concurrency suite. Every review-unit head compiles and passes its focused tests independently.