Skip to content

fix(tasks): expire soft-deleted tabulars in inactive warehouses - #2151

Merged
c-thiel merged 1 commit into
mainfrom
fix/expire-soft-deleted-tables-in-inactive-warehouses
Oct 20, 2026
Merged

c-thiel merged 1 commit into
mainfrom
fix/expire-soft-deleted-tables-in-inactive-warehouses

Conversation

@c-thiel

@c-thiel c-thiel commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Summary

A soft-deleted table, view or generic table whose expiry passed while its warehouse was inactive was never dropped. The expiration task did not find the tabular, logged a warning and recorded success. The tabular stayed soft-deleted forever, and with purge, its files were never deleted.

drop_tabular now also drops tabulars in inactive warehouses. The purge that follows already runs in inactive warehouses. The API drop paths are unchanged: they load the tabular through an active warehouse first.

Changes

  • Removed the active-warehouse filter from the drop_tabular query. The drop_tabular trait docs now state that it works in active and inactive warehouses.
  • .sqlx regenerated for the changed query.

Tests

  • New test_expiration_queue_drops_table_in_inactive_warehouse: a soft-deleted table in an inactive warehouse is dropped on schedule, and its purge is scheduled. It fails without the fix.
  • test_drop_tabular_inactive_warehouse_returns_404 pinned the old filter. It is now test_drop_tabular_inactive_warehouse_succeeds and asserts that the drop returns the table's location.

Notes for reviewers

  • Tabulars that already expired this way stay soft-deleted, because their expiration task is gone. This PR does not find or reschedule them.

Release notes

  • Soft-deleted tables, views and generic tables now expire on schedule even while their warehouse is inactive. Before, their expiry was skipped, and they and their files stayed forever.

Summary by CodeRabbit

  • Bug Fixes

    • Tabular objects can now be deleted successfully from inactive warehouses.
    • Soft-deleted tables are physically removed on schedule, including when their warehouse is inactive.
    • Purge tracking now confirms a single task is retained across active tasks and task logs.
  • Documentation

    • Clarified that staged and non-staged tables and views can be deleted from both active and inactive warehouses.

@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown
Contributor

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ebab92a9-4740-4d44-b2ce-dbeab8c90f2a
📥 Commits

Reviewing files that changed from the base of the PR and between f3769b2 and f9683db.

⛔ Files ignored due to path filters: 1
  • .sqlx/query-9b77f5ead28a3c036984bb5751e2e17885a41aea990717e09eaab248b2a62ab4.json is excluded by !.sqlx/**
📒 Files selected for processing: 4
  • crates/lakekeeper-integration-tests/tests/service_tabular_expiration_queue.rs
  • crates/lakekeeper-storage-postgres/src/tabular/mod.rs
  • crates/lakekeeper/src/service/catalog_store.rs
  • crates/lakekeeper/src/service/catalog_store/tabular.rs

Included review availability: This review used your included allowance. Your plan provides up to 4 included reviews per hour; 2 remain after this review.

Walkthrough

Tabular deletion now works for inactive warehouses. Storage tests and a new integration test verify that scheduled expiry removes a soft-deleted table in an inactive warehouse and records one corresponding purge task or log entry.

Changes

Inactive warehouse expiry

Layer / File(s) Summary
Allow deletion in inactive warehouses
crates/lakekeeper-storage-postgres/src/tabular/mod.rs, crates/lakekeeper/src/service/catalog_store.rs, crates/lakekeeper/src/service/catalog_store/tabular.rs
drop_tabular no longer filters by warehouse status. The storage test and service documentation reflect deletion in inactive warehouses.
Verify scheduled expiry
crates/lakekeeper-integration-tests/tests/service_tabular_expiration_queue.rs
An integration test schedules expiry, marks the warehouse inactive, and checks for table removal and one corresponding purge task or log entry.

Priority: ⬇️ Low

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested reviewers: brgr-s

Merge Risk: ⚪ Minimal · up to f9683

No actionable issue remains identified for the inactive-warehouse expiry change; it is mergeable after normal checks.

Pre-merge checks: Passed 5
Check name Status Explanation
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check Passed The title clearly and concisely describes the primary change: expiring soft-deleted tabulars in inactive warehouses.
Docstring Coverage Passed Docstring coverage is 83.33% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 4 files.
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

A rabbit checks the queue at night
A table fades from stored view
The warehouse rests, the task remains
One log records the work complete
Soft-deleted rows give way to spring

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown
Contributor

✅ PR Title Formatted Correctly

The title of this PR match the correct format. Thank you!

@c-thiel
c-thiel enabled auto-merge (squash) October 20, 2026 18:04
@c-thiel
c-thiel merged commit 68cebec into main Oct 20, 2026
77 checks passed
@c-thiel
c-thiel deleted the fix/expire-soft-deleted-tables-in-inactive-warehouses branch October 20, 2026 19:10
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.

1 participant