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

feat: change to snapshot isolation #2537

Merged
merged 4 commits into from
Jun 27, 2024

Conversation

wjones127
Copy link
Contributor

@wjones127 wjones127 commented Jun 26, 2024

BREAKING CHANGE: This changes commit semantics from serializable to snapshot isolation. This will allow Delete and Update queries to always succeed with concurrent Append transactions.

This also bumps up the default internal retries to 20, which should reduce the incidence of transaction failures.

Closes: #2143

BREAKING CHANGE: This changes commit semantics from serializable to
snapshot isolation. This will allow Delete and Update queries to always
succeed with concurrent Append transactions.

This also bumps up the default internal retries to 20, which should
reduce the incidence of transaction failures.
@github-actions github-actions bot added enhancement New feature or request breaking-change labels Jun 26, 2024
@codecov-commenter
Copy link

codecov-commenter commented Jun 26, 2024

Codecov Report

Attention: Patch coverage is 90.32258% with 3 lines in your changes missing coverage. Please review.

Project coverage is 79.78%. Comparing base (63227f4) to head (7f81f37).

Files Patch % Lines
rust/lance/src/io/commit.rs 85.71% 0 Missing and 3 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2537      +/-   ##
==========================================
+ Coverage   79.76%   79.78%   +0.02%     
==========================================
  Files         207      207              
  Lines       59586    59602      +16     
  Branches    59586    59602      +16     
==========================================
+ Hits        47528    47556      +28     
+ Misses       9264     9259       -5     
+ Partials     2794     2787       -7     
Flag Coverage Δ
unittests 79.78% <90.32%> (+0.02%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

Copy link
Contributor

@westonpace westonpace left a comment

Choose a reason for hiding this comment

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

I think this is fine but it would still be good to make the number of retries configurable. If an application is supporting adds from users and there are X concurrent users then it seems like there will eventually, at some point, need to be at least X retries. Although maybe users should be doing some kind of internal batching once they start to have more than 20 appends per second?

@@ -20,7 +20,7 @@ exclude = ["python"]
resolver = "2"

[workspace.package]
version = "0.13.1"
version = "0.14.0"
Copy link
Contributor

Choose a reason for hiding this comment

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

Are you also bumping the lance version?

Copy link
Contributor Author

@wjones127 wjones127 Jun 26, 2024

Choose a reason for hiding this comment

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

Doing this to pass the breaking change policy check.

@wjones127
Copy link
Contributor Author

I think this is fine but it would still be good to make the number of retries configurable.

I agree, just don't have appetite to change the necessary APIs at the moment. Would require plumbing a new parameter through every single write operation. Left it as a TODO in #2538

@wjones127 wjones127 marked this pull request as ready for review June 27, 2024 00:49
@@ -494,6 +505,18 @@ pub(crate) async fn commit_transaction(
})
}

fn backoff_time(attempt_i: u32) -> std::time::Duration {
Copy link
Contributor

Choose a reason for hiding this comment

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

unrelated nit: we could make a RetryIterator<Item = Duration>

@wjones127 wjones127 merged commit e631644 into lancedb:main Jun 27, 2024
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow append and delete to not conflict
4 participants