Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: allow more than 15 concurrent transactions to have been committed #3067

Merged
merged 3 commits into from
Dec 20, 2024

Conversation

rtyler
Copy link
Member

@rtyler rtyler commented Dec 18, 2024

There are high-concurrency scenarios where multiple writers may have committed versions to the log since the current process' state was loaded. Because of the snapshot.version() + 1 and retry logic in the transaction commit operation, this would result in failures if more than 15 versions had been committed since the table state had been loaded.

This approach fetches the latest known version on the table prior to committing the transaction, and if the latest version has shifted, it will perform a conflict check with the versions that have since been committed.

Fixes #3066

@github-actions github-actions bot added the binding/rust Issues for the Rust crate label Dec 18, 2024
Copy link

ACTION NEEDED

delta-rs follows the Conventional Commits specification for release automation.

The PR title and description are used as the merge commit message. Please update your PR title and description to match the specification.

@rtyler rtyler changed the title fix: allow more than 15 concurrent transactions to have been committed fix: allow more than 15 concurrent transactions to have been committed Dec 18, 2024
a number of our transitive dependencies have forced the upgrade in patch
versions of the Minimum Supported Rust Version (MSRV) and broke builds
from crates.io and `main` on Rust 1.80. 😒

This change upgrades us to 1.81 but bumps to 0.23 in the process.

Signed-off-by: R. Tyler Croy <[email protected]>
…r use

This will help retry logic associated with the logstore to directly find
the appropriate next c ommit

Related to #3306

Signed-off-by: R. Tyler Croy <[email protected]>
There are high-concurrency scenarios where multiple writers may have
committed versions to the log since the current process' state was
loaded. Because of the `snapshot.version() + 1` and retry logic in the
transaction commit operation, this would result in failures if more than
15 versions had been committed since the table state had been loaded.

This approach fetches the latest known version on the table prior to
committing the transaction, and if the latest version has shifted, it
will perform a conflict check with the versions that have since been
committed.

Fixes delta-io#3066

Signed-off-by: R. Tyler Croy <[email protected]>
Sponsored-by: Scribd Inc
@rtyler rtyler force-pushed the logstore-retry-backoff branch from 28fc839 to 8e308e2 Compare December 19, 2024 14:25
@github-actions github-actions bot added the binding/python Issues for the Python package label Dec 19, 2024
@rtyler
Copy link
Member Author

rtyler commented Dec 19, 2024

Note: This pull request is rebased on #3069 so that the CI would pass. I would expect the other pull request to be merged first

@rtyler rtyler marked this pull request as ready for review December 19, 2024 14:44
@rtyler rtyler enabled auto-merge December 19, 2024 14:45
@rtyler rtyler added this to the v0.23 milestone Dec 19, 2024
Copy link

codecov bot commented Dec 19, 2024

Codecov Report

Attention: Patch coverage is 83.33333% with 8 lines in your changes missing coverage. Please review.

Project coverage is 72.41%. Comparing base (99e39ca) to head (8e308e2).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
crates/core/src/operations/transaction/mod.rs 86.11% 0 Missing and 5 partials ⚠️
crates/core/src/logstore/mod.rs 70.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@           Coverage Diff            @@
##             main    #3067    +/-   ##
========================================
  Coverage   72.41%   72.41%            
========================================
  Files         128      128            
  Lines       41314    41007   -307     
  Branches    41314    41007   -307     
========================================
- Hits        29918    29696   -222     
- Misses       9426     9429     +3     
+ Partials     1970     1882    -88     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@rtyler rtyler added this pull request to the merge queue Dec 20, 2024
@ion-elgreco
Copy link
Collaborator

Looks good!

Just a question, the issue also mentions to also introduce exponential backoff. But I don't see that being implemented here, are you addressing that in another PR?

Merged via the queue into delta-io:main with commit b241bf6 Dec 20, 2024
24 checks passed
@rtyler rtyler deleted the logstore-retry-backoff branch December 20, 2024 08:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
binding/python Issues for the Python package binding/rust Issues for the Rust crate
Projects
None yet
Development

Successfully merging this pull request may close these issues.

TransactionError::VersionAlreadyExists needs exponential backoff with commit peeking
2 participants