Repository navigation
Conversation
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>
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.
Closes apache#4625
Rationale for this change
purge_tablereads manifest lists and manifests before it callsdelete_files. If a REST catalog has already removed some of those files, for example eagerly during a commit or drop, that read raisesFileNotFoundErrorand 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_filesitself.Are these changes tested?
Yes.
test_purge_table_skips_already_missing_manifest_filescreates 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_errorschecks that a permission error while reading a manifest still raises.tests/catalog/test_catalog_behaviors.pypasses (872 passed), and ruff check and format are clean.Are there any user-facing changes?
Yes.
purge_tableno longer fails when a manifest or manifest list is already gone, so remaining table files can still be cleaned up.