msabiransari opened a new pull request, #18745: URL: https://github.com/apache/iceberg/pull/18745
`JdbcTableOperations` treats a zero-row result from the compare-and-swap `UPDATE` as a concurrent commit and throws `CommitFailedException`, which triggers cleanup of the files the commit wrote. When the database applied the `UPDATE` but the connection dropped before the response arrived, `JdbcClientPool` reconnects and replays the statement, which then matches zero rows: the catalog already points at the new metadata, and cleanup deletes the committed metadata file and manifests. With the default commit retries a concurrent writer can also silently rewind the table. On zero rows the operations now check the commit status strictly, as the Hive catalog does: success when the new location is current or in the history, `CommitStateUnknownException` when the check cannot run, `CommitFailedException` otherwise. `JdbcViewOperations` has the same pattern and is left for a follow-up. Fixes #18743. Test plan: with no commit retries, a replayed update (statement applied, zero rows reported) commits and the appended file is readable, which proves no cleanup ran; with default retries, a second writer that commits between the replayed update and the retry is not rewound, and both files stay visible; a zero-row update whose location never reached the catalog still fails with `CommitFailedException` and leaves no snapshot, which proves a real conflict is still refused. The first two tests fail on the current code. --- **AI Disclosure** - Model: Claude Fable 5.1 - Platform/Tool: Claude Code - Human Oversight: [unknown - human to fill in] - Prompt Summary: Reproduce the lost-acknowledgement commit failure in the JDBC catalog reported in #18743 and fix it following the strict commit status check the other catalogs use. The fix, both tests and the reproduction project attached to the issue are generated; the decision to file and fix is the author's. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
