[python] Abort failed update-by-row-id writes#8483
Merged
Conversation
Abort FileStoreWrite and BlobWriter when update-by-row-id fails after files have been written but before commit messages are returned. This prevents orphan data or blob files from accumulating after failed batch jobs. Add a regression test that forces a failure after prepare_commit and verifies the table directory does not gain uncommitted files. Signed-off-by: QuakeWang <wangfuzheng0814@foxmail.com>
Contributor
|
+1 |
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.
Purpose
TableUpdateByRowId._write_group()used to close writers when an exception happened after data/blob files had already been written but before commit messages were returned.close()preserves prepared files, so failed update-by-row-id jobs could leave orphan data or blob files even though no manifest commit happened.This PR tracks whether the write group completed successfully. On failure, it aborts the
FileStoreWriteand anyBlobWriters so their already-written files are cleaned up. Successful writes still follow the existing close path.Tests
python -m py_compile pypaimon/write/table_update_by_row_id.py pypaimon/tests/table_update_test.pypython -m pytest pypaimon/tests/table_update_test.py -qpython -m pytest pypaimon/tests/blob_table_test.py::DedicatedFormatWriterTest::test_update_blob_column -q