Skip to content

[python] Abort failed update-by-row-id writes#8483

Merged
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:rowid-abort-cleanup
Jul 7, 2026
Merged

[python] Abort failed update-by-row-id writes#8483
JingsongLi merged 1 commit into
apache:masterfrom
QuakeWang:rowid-abort-cleanup

Conversation

@QuakeWang

Copy link
Copy Markdown
Member

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 FileStoreWrite and any BlobWriters 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.py
  • python -m pytest pypaimon/tests/table_update_test.py -q
  • python -m pytest pypaimon/tests/blob_table_test.py::DedicatedFormatWriterTest::test_update_blob_column -q

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>
@JingsongLi

Copy link
Copy Markdown
Contributor

+1

@JingsongLi JingsongLi merged commit 5b1a460 into apache:master Jul 7, 2026
6 checks passed
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.

2 participants