Repository navigation
feat(iceberg): clear catalog artifacts on database drop - #694
Merged
Merged
Conversation
Completes #639 (item 3, the last open item). Exporter.DropDatabase drops each table in the database's namespace (the SQL catalog's DropNamespace refuses non-empty namespaces), the namespace itself (ErrNoSuchNamespace tolerated for never-exported databases), and the warehouse metadata tree, sweeping the now-empty directories deepest-first since RemoveDirectory is non-recursive. Wired into the database-delete API after file deletion, files-first so a racing reconcile can only empty tables, and also best-effort on the not-found path so re-running the DELETE converges after a crash. Spoke pseudo-databases are refused. Closes #639
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
DELETE /api/v1/databases/{name}now also removes the database's Iceberg catalog tables, its namespace, and its warehouse metadata directory, previously all of it persisted foreverEnsureTable; catalog-first was explicitly rejected in plan review for that reasonDropNamespacerefuses non-empty namespaces, so tables are dropped individually first;ErrNoSuchNamespacereads as success (database never exported), making the operation idempotentRemoveDirectoryis non-recursive, which is the very behavior the issue documents); spoke pseudo-databases are refused (their lifecycle belongs to edge-sync, and the review confirmed a bare spoke-ID delete hits a nonexistent namespace harmlessly)Verification
iceberg_tablesand namespace properties and removes the warehouse namespace tree, second drop and never-exported drop are no-ops, namespaced names refusedRefs #693 (items 2/5/7/8). Closes #639.