Skip to content

Skip missing manifests when purging a table - #1

Open
Zu67 wants to merge 1 commit into
mainfrom
cursor/fix-4625-purge-missing-manifests-fd6d
Open

Zu67 wants to merge 1 commit into
mainfrom
cursor/fix-4625-purge-missing-manifests-fd6d

Conversation

@Zu67

@Zu67 Zu67 commented Dec 5, 2026

Copy link
Copy Markdown
Owner

Closes apache#4625

Rationale for this change

purge_table reads manifest lists and manifests before it calls delete_files. If a REST catalog has already removed some of those files, for example eagerly during a commit or drop, that read raises FileNotFoundError and the rest of the table's files are left behind.

This change skips a missing manifest list or manifest, logs it at debug level, and continues deleting every file that can still be found. Other errors, such as permission errors, still propagate. apache#4617 covers the matching case in delete_files itself.

Are these changes tested?

Yes. test_purge_table_skips_already_missing_manifest_files creates a table with two snapshots, deletes a manifest list or a manifest from disk to stand in for the server, and checks that purge still drops the table and deletes the remaining files. It fails without the fix and passes with it on the memory and SqlCatalog fixtures. test_delete_data_files_propagates_other_read_errors checks that a permission error while reading a manifest still raises. tests/catalog/test_catalog_behaviors.py passes (872 passed), and ruff check and format are clean.

Are there any user-facing changes?

Yes. purge_table no longer fails when a manifest or manifest list is already gone, so remaining table files can still be cleaned up.

Open in Web Open in Cursor 

purge_table reads manifest lists and manifests before delete_files.
If a REST catalog has already removed those files, the read raises
FileNotFoundError and nothing gets cleaned up.

Skip a missing manifest list or manifest, log it at debug level, and
keep deleting every file that can still be found. Other errors still
propagate.

Closes apache#4625

Co-authored-by: Zubair Tahir <Zu67@users.noreply.github.com>
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.

purge_table raises if a manifest or manifest list was already removed by the catalog

2 participants