-
Notifications
You must be signed in to change notification settings - Fork 3.8k
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
kv: expose isolation level through kv.Txn API #100900
kv: expose isolation level through kv.Txn API #100900
Conversation
b3a576c
to
d6a530e
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reviewed 5 of 5 files at r1, 16 of 16 files at r2, 6 of 6 files at r3, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @DrewKimball and @nvanbenschoten)
pkg/kv/kvclient/kvcoord/txn_coord_sender_test.go
line 74 at r3 (raw file):
// TestTxnCoordSenderAssignsTxnKey verifies that a transaction is assigned a // transaction record key corresponding to the first key it writes.
Do you think it's worth extending this test to check for locking reads as well? Doesn't have to be in this patch.
Fixes cockroachdb#100130. This commit exposes isolation levels through the kv.Txn API with the introduction of a new `SetIsoLevel` method. This method behaves similarly to `SetUserPriority`. Notably, the isolation must be set before any operations are performed on the transaction. Release note: None
d6a530e
to
2e83183
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TFTR!
bors r=arulajmani
Reviewable status: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @arulajmani and @DrewKimball)
pkg/kv/kvclient/kvcoord/txn_coord_sender_test.go
line 74 at r3 (raw file):
Previously, arulajmani (Arul Ajmani) wrote…
Do you think it's worth extending this test to check for locking reads as well? Doesn't have to be in this patch.
TestTxnHeartbeaterLoopStartedOnFirstLock
is a better test that sits alongside TestTxnHeartbeaterSetsTransactionKey
and exercises that case, so I don't think we need anything more here. This test here is already of limited utility. I'm reviving it mostly because it gives coverage of a setting and getting a few txn attributes.
Build failed: |
Bors flaked on a timeout in bors r+ |
Build succeeded: |
Fixes #100130.
This commit exposes isolation levels through the kv.Txn API with the introduction of a new
SetIsoLevel
method. This method behaves similarly toSetUserPriority
. Notably, the isolation must be set before any operations are performed on the transaction.Release note: None