iceberg-go icon indicating copy to clipboard operation
iceberg-go copied to clipboard

table.doCommit call fails when metadata file is already removed

Open jwtryg opened this issue 8 months ago • 1 comments

Apache Iceberg version

main (development)

Please describe the bug 🐞

When write.metadata.delete-after-commit.enabled is set to true, the deleteOldMetadata function will delete the old metadata files from the underlying fs. If this deletion fails, then the doCommit call will fail, even though the commit itself actually succeeded. This will happen fx. if a metadata file to be deleted has already been deleted by an external entity.

This problem occurs when using the Lakekeeper rest catalog implementation. Lakekeeper will also delete old metadata files when committing if write.metadata.delete-after-commit.enabled is set to true.

For reference, pyIceberg will simply log any failed delete. Should the goIceberg client maybe use the same approach?

I am happy to submit a PR to change this behaviour.

jwtryg avatar Apr 30 '25 05:04 jwtryg

That seems like a reasonable solution!

I am happy to submit a PR to change this behaviour.

Please do! I'll happily review it

zeroshade avatar Apr 30 '25 14:04 zeroshade