Skip to content

Conversation

@jembishop
Copy link
Contributor

Which issue does this PR close?

#1868

What changes are included in this PR?

As referenced in the issue, the optimistic concurrency was not working correctly as we need to check the glue table version has not incremented before we make our update, so we can get back the error if there is a concurrent modification.

This changes the update_table to properly handle this case.

Also changed the load_table to load_table_with_version_id, and load_table now just uses that.

Are these changes tested?

I have tested them using my specific setup with concurrent writers to iceberg tables in aws glue, but not generically. Writing a test case doesn't seem feasible as one needs a glue table.

Jem Bishop and others added 3 commits November 17, 2025 11:08
- Fetch current VersionId from Glue table before commit
- Pass version_id to update_table() to enable proper optimistic locking
- Prevents concurrent commits from silently overwriting each other
- Fixes orphaned files issue when multiple writers commit simultaneously
@jembishop jembishop changed the title Version fix Raise concurrency errors with concurrent glue table modification Nov 19, 2025
@jembishop jembishop changed the title Raise concurrency errors with concurrent glue table modification Raise concurrency errors properly for glue tables Nov 19, 2025
Copy link
Member

@Xuanwo Xuanwo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for working on this!

@Xuanwo Xuanwo merged commit 760b752 into apache:main Nov 19, 2025
18 checks passed
sgrebnov pushed a commit to spiceai/iceberg-rust that referenced this pull request Nov 29, 2025
## Which issue does this PR close?
apache#1868

## What changes are included in this PR?

As referenced in the issue, the optimistic concurrency was not working
correctly as we need to check the glue table version has not incremented
before we make our update, so we can get back the error if there is a
concurrent modification.

This changes the `update_table` to properly handle this case.

Also changed the `load_table` to `load_table_with_version_id`, and
`load_table` now just uses that.

<!--
Provide a summary of the modifications in this PR. List the main changes
such as new features, bug fixes, refactoring, or any other updates.
-->

## Are these changes tested?

I have tested them using my specific setup with concurrent writers to
iceberg tables in aws glue, but not generically. Writing a test case
doesn't seem feasible as one needs a glue table.
<!--
Specify what test covers (unit test, integration test, etc.).

If tests are not included in your PR, please explain why (for example,
are they covered by existing tests)?
-->

---------

Co-authored-by: Jem Bishop <jem@lo.tech>
# Conflicts:
#	crates/catalog/glue/src/catalog.rs
sgrebnov added a commit to spiceai/iceberg-rust that referenced this pull request Nov 29, 2025
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