Repository navigation
fix(catalog): a dropped table keeps its location until its purge has finished - #2270
Conversation
…finished A drop with purge deletes the catalog entry at once and queues a task that deletes the files later. Until now the location was free as soon as the entry was gone. Another table, view or generic table could take the same location, a folder inside it or a parent folder before the purge ran, for example by registering the dropped table's metadata file again. The purge then deleted its files. The location check now also matches queued or running purge tasks of the warehouse, in the same statement as the check for existing tables and views. Creating a table, view or generic table, registering a table, or moving a view to such a location fails with 409 LocationAlreadyTaken until the purge task has ended.
|
No actionable comments were generated in the recent review. WalkthroughLocation availability checks now include queued or running purge tasks. Overlapping locations remain blocked until purge completes, with a distinct conflict response. Integration tests cover path overlaps and reuse after purge, and the documentation describes the reservation. ChangesPending-Purge Location Reservation
Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix Possibly related PRs
Suggested reviewers: Merge Risk:
|
✅ PR Title Formatted CorrectlyThe title of this PR match the correct format. Thank you! |
In a warehouse without soft deletion, dropping a table, view or generic table with purge (the default when the client sends no
purgeRequested) removes it from the catalog at once and deletes its files later, in a purge task. With soft deletion, the same happens when the soft deletion expires. Until now the location was free as soon as the catalog entry was gone. Another table, view or generic table could take the same location, a folder inside it or a parent folder before or while the purge ran, for example by registering the dropped table's metadata file again. The purge then deleted the files of that table.Lakekeeper now treats the location as taken while a purge task for it is queued or running. Creating a table, view or generic table, registering a table, or moving a view there fails with
409 LocationAlreadyTakenand the message "Location '…' overlaps the location of a dropped table, view or generic table whose files a purge task will delete. The location is free again when that task has finished." The location is free again when the purge task has finished, failed for good or was cancelled.For reviewers:
tabular_locationfrom the purge task payload. The new tests fail if the queue name or the payload key changes.Release notes
409until the purge task has finished.Downstream follow-up
409 LocationAlreadyTaken.Summary by CodeRabbit