-
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: implement replicated key-level locks #100193
Labels
A-kv-transactions
Relating to MVCC and the transactional model.
A-read-committed
Related to the introduction of Read Committed
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-kv
KV Team
Comments
nvanbenschoten
added
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
A-kv-transactions
Relating to MVCC and the transactional model.
T-kv
KV Team
A-read-committed
Related to the introduction of Read Committed
labels
Mar 30, 2023
nvanbenschoten
changed the title
kv: implement and use replicated key-level locks
kv: implement replicated key-level locks
Mar 30, 2023
This was referenced Mar 30, 2023
The API for replicated key-level locks will look similar to the API for unreplicated key-level locks. |
michae2
added a commit
to michae2/cockroach
that referenced
this issue
May 22, 2023
Temporarily disallow `SELECT FOR UPDATE` statements under all isolation levels that are not `SERIALIZABLE` (i.e. `SNAPSHOT` and `READ COMMITTED`). We will allow them again when the following issues are fixed: - cockroachdb#57031 - cockroachdb#75457 - cockroachdb#100193 - cockroachdb#100194 Fixes: cockroachdb#100144 Release note: None
michae2
added a commit
to michae2/cockroach
that referenced
this issue
May 23, 2023
Temporarily disallow `SELECT FOR UPDATE` statements under all isolation levels that are not `SERIALIZABLE` (i.e. `SNAPSHOT` and `READ COMMITTED`). We will allow them again when the following issues are fixed: - cockroachdb#57031 - cockroachdb#75457 - cockroachdb#100193 - cockroachdb#100194 Fixes: cockroachdb#100144 Release note: None
michae2
added a commit
to michae2/cockroach
that referenced
this issue
May 25, 2023
Temporarily disallow `SELECT FOR UPDATE` statements under all isolation levels that are not `SERIALIZABLE` (i.e. `SNAPSHOT` and `READ COMMITTED`). We will allow them again when the following issues are fixed: - cockroachdb#57031 - cockroachdb#75457 - cockroachdb#100193 - cockroachdb#100194 Fixes: cockroachdb#100144 Release note: None
craig bot
pushed a commit
that referenced
this issue
May 25, 2023
103734: opt: disallow SELECT FOR UPDATE under weak isolation levels r=nvanbenschoten,mgartner a=michae2 **querycache: remove unused field from CachedData** Remove the `IsCorrelated` flag from `querycache.CachedData`, which is no longer used. Release note: None --- **sql/opt: add locking durability** In addition to strength and wait policy, we now add a third property to locks: durability. Locks with `LockDurabilityGuaranteed` are guaranteed to be held until commit (if the transaction commits). Durable locks must be used when correctness depends on locking. This is never the case under our `SERIALIZABLE` isolation, but under `SNAPSHOT` and `READ COMMITTED` isolation it will be the case for `SELECT FOR UPDATE` statements, which will be the first users of durable locks. This commit adds locking durability to the optimizer and `EXPLAIN` output, but does not plumb it into KV yet. It will be used in the next commit to temporarily disallow `SELECT FOR UPDATE` statements under `SNAPSHOT` and `READ COMMITTED` isolation. Release note: None --- **opt: disallow SELECT FOR UPDATE under weak isolation levels** Temporarily disallow `SELECT FOR UPDATE` statements under all isolation levels that are not `SERIALIZABLE` (i.e. `SNAPSHOT` and `READ COMMITTED`). We will allow them again when the following issues are fixed: - #57031 - #75457 - #100193 - #100194 Fixes: #100144 Release note: None Co-authored-by: Michael Erickson <[email protected]>
michae2
added a commit
to michae2/cockroach
that referenced
this issue
Jul 19, 2023
This is a follow-up from cockroachdb#103734. We do not want to use guaranteed-durable (a.k.a. replicated) locking under serializable isolation, because it prevents pipelining and other optimizations, and is unnecessary for correctness. This commit ammends 8cbc6d1 to only set durability for `SELECT FOR UPDATE` locking under weaker isolation levels. This means that query plans will be slightly different under different isolation levels, and so we must add isolation level to the optimizer memo staleness calculation. Furthermore, this commit changes the error message added by e633d5e to be about guaranteed-durable locking rather than `SELECT FOR UPDATE`, because in a later commit this specific error will also be triggered by foreign key checks under weaker isolation levels. Informs: cockroachdb#100144, cockroachdb#100156, cockroachdb#100193, cockroachdb#100194 Release note: None
michae2
added a commit
to michae2/cockroach
that referenced
this issue
Jul 21, 2023
This is a follow-up from cockroachdb#103734. We do not want to use guaranteed-durable (a.k.a. replicated) locking under serializable isolation, because it prevents pipelining and other optimizations, and is unnecessary for correctness. This commit ammends 8cbc6d1 to only set durability for `SELECT FOR UPDATE` locking under weaker isolation levels. This means that query plans will be slightly different under different isolation levels, and so we must add isolation level to the optimizer memo staleness calculation. Furthermore, this commit changes the error message added by e633d5e to be about guaranteed-durable locking rather than `SELECT FOR UPDATE`, because in a later commit this specific error will also be triggered by foreign key checks under weaker isolation levels. Informs: cockroachdb#100144, cockroachdb#100156, cockroachdb#100193, cockroachdb#100194 Release note: None
michae2
added a commit
to michae2/cockroach
that referenced
this issue
Jul 26, 2023
This is a follow-up from cockroachdb#103734. We do not want to use guaranteed-durable (a.k.a. replicated) locking under serializable isolation, because it prevents pipelining and other optimizations, and is unnecessary for correctness. This commit ammends 8cbc6d1 to only set durability for `SELECT FOR UPDATE` locking under weaker isolation levels. This means that query plans will be slightly different under different isolation levels, and so we must add isolation level to the optimizer memo staleness calculation. Furthermore, this commit changes the error message added by e633d5e to be about guaranteed-durable locking rather than `SELECT FOR UPDATE`, because in a later commit this specific error will also be triggered by foreign key checks under weaker isolation levels. Informs: cockroachdb#100144, cockroachdb#100156, cockroachdb#100193, cockroachdb#100194 Release note: None
THardy98
pushed a commit
to THardy98/cockroach
that referenced
this issue
Oct 6, 2023
…teBatch Informs cockroachdb#91545. Informs cockroachdb#100193. This commit extends TestEvaluateBatch to include shared, replicated, and shared-replicated lock acquisition using Get, Scan, and ReverseScan requests. Release note: None
THardy98
pushed a commit
to THardy98/cockroach
that referenced
this issue
Oct 6, 2023
…tRequests Informs cockroachdb#91545. Informs cockroachdb#100193. This commit expands TestLockTableConcurrentRequests to support Shared, Exclusive, and Intent locking strength, in addition to both Replicated and Unreplicated locking durabilities. This provides randomized coverage of the lock table with these combinations. The commit then temporarily disables Shared locks in the test, which occasionally fail with the panic: `tryMakeNewDistinguished called with new claimant txn`. This is related to cockroachdb#111144, so we can re-enable Shared locks when that issue is resolved. Release note: None
THardy98
pushed a commit
to THardy98/cockroach
that referenced
this issue
Oct 6, 2023
Informs cockroachdb#100193. This commit addresses a TODO left by cockroachdb#110319 to implement an "iter before seek" optimization in the LockTableIterator, similar to the one that exists in the pebbleMVCCScanner. The optimization places an upper bound on the number of iterations that a LockTableIterator that is configured to ignore some or all shared locks will perform across the shared locks on a single user key before seeking past them. This is used to avoid iterating over all shared locks on a key when not necessary. The optimization achieves the goal of avoiding cases of O(ignored_locks) work in the LockTableIterator, instead performing at most O(matching_locks + locked_keys) work. This is important for iteration over the lock table (e.g. intentInterleavingIter), lock acquisition (MVCCAcquireLock), and lock release (mvccReleaseLockInternal). There is a caveat to these complexity bounds, however, in that they do not consider LSM tombstones. This is being discussed in cockroachdb#110324. Release note: None
aliher1911
pushed a commit
to aliher1911/cockroach
that referenced
this issue
Oct 9, 2023
Fixes cockroachdb#109645. Informs cockroachdb#100193. This commit adds `MVCCStats` for replicated locks. To do so, it first adds a new field to the stats struct, `LockBytes`. `LockBytes` is the encoded size of replicated locks with shared or exclusive strengths, which are stored in the lock table keyspace. The field includes the size of the locks' keys and their values. For historical reasons, the field excludes the size of intent metadata key-values, even though they are also stored in the lock table keyspace. Intent metadata keys are tracked under KeyBytes and their values are tracked under ValBytes. This is not to be confused with the provisional versioned values protected by the intents, which are tracked by the IntentBytes field (and also by KeyBytes and ValBytes). Hence the vague "without their meta keys" comment above. The patch then begins accounting for the contributions of replicated locks to `LockBytes`, `LockCount`, and `LockAge`, of which the second two fields already exist. This accounting is straightforward. The less straightforward part of the patch is MVCC stats computation. Scanning the lock table requires the use of an EngineIterator. To this point, all stats computation has taken place on an MVCCIterator. The patch addresses this by directly scanning the lock table with an EngineIterator (wrapped in a LockTableIterator) during stats computation. Release note: None
aliher1911
pushed a commit
to aliher1911/cockroach
that referenced
this issue
Oct 9, 2023
…teBatch Informs cockroachdb#91545. Informs cockroachdb#100193. This commit extends TestEvaluateBatch to include shared, replicated, and shared-replicated lock acquisition using Get, Scan, and ReverseScan requests. Release note: None
aliher1911
pushed a commit
to aliher1911/cockroach
that referenced
this issue
Oct 9, 2023
…tRequests Informs cockroachdb#91545. Informs cockroachdb#100193. This commit expands TestLockTableConcurrentRequests to support Shared, Exclusive, and Intent locking strength, in addition to both Replicated and Unreplicated locking durabilities. This provides randomized coverage of the lock table with these combinations. The commit then temporarily disables Shared locks in the test, which occasionally fail with the panic: `tryMakeNewDistinguished called with new claimant txn`. This is related to cockroachdb#111144, so we can re-enable Shared locks when that issue is resolved. Release note: None
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this issue
Nov 20, 2023
Informs cockroachdb#100193. This commit adds two new microbenchmarks: - `BenchmarkMVCCCheckForAcquireLock_Pebble` - `BenchmarkMVCCAcquireLock_Pebble` These sit atop the `MVCCCheckForAcquireLock` and `MVCCAcquireLock` functions, which were introduced in cockroachdb#110323. Initial results: ``` name time/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 1.02µs ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 1.02µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.41µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.47µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.48µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.60µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 448ns ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 456ns ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 1.61µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 1.57µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.95µs ±39% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 4.75µs ± 8% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 4.52µs ± 4% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 4.01µs ± 3% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 4.02µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.31µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.62µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 880ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 871ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.92µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.91µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.71µs ± 2% name alloc/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 336B ±35% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 713B ± 1% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 713B ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 299B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 251B ±27% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 198B ± 1% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 811B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 810B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% name allocs/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.30 ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% ``` The next commit will optimize `BenchmarkMVCCAcquireLock_Pebble/./heldOtherTxn=false/heldSameTxn=true/.`. Release note: None
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this issue
Nov 20, 2023
Informs cockroachdb#100193. This commit adds two new microbenchmarks: - `BenchmarkMVCCCheckForAcquireLock_Pebble` - `BenchmarkMVCCAcquireLock_Pebble` These sit atop the `MVCCCheckForAcquireLock` and `MVCCAcquireLock` functions, which were introduced in cockroachdb#110323. Initial results: ``` name time/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 1.02µs ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 1.02µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.41µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.47µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.48µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.60µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 448ns ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 456ns ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 1.61µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 1.57µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.95µs ±39% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 4.75µs ± 8% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 4.52µs ± 4% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 4.01µs ± 3% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 4.02µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.31µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.62µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 880ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 871ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.92µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.91µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.71µs ± 2% name alloc/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 336B ±35% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 713B ± 1% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 713B ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 299B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 251B ±27% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 198B ± 1% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 811B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 810B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% name allocs/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.30 ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% ``` Release note: None
nvanbenschoten
added a commit
to nvanbenschoten/cockroach
that referenced
this issue
Nov 23, 2023
Informs cockroachdb#100193. This commit adds two new microbenchmarks: - `BenchmarkMVCCCheckForAcquireLock_Pebble` - `BenchmarkMVCCAcquireLock_Pebble` These sit atop the `MVCCCheckForAcquireLock` and `MVCCAcquireLock` functions, which were introduced in cockroachdb#110323. Initial results: ``` name time/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 1.02µs ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 1.02µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.41µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.47µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.48µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.60µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 448ns ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 456ns ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 1.61µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 1.57µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.95µs ±39% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 4.75µs ± 8% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 4.52µs ± 4% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 4.01µs ± 3% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 4.02µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.31µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.62µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 880ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 871ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.92µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.91µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.71µs ± 2% name alloc/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 336B ±35% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 713B ± 1% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 713B ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 299B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 251B ±27% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 198B ± 1% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 811B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 810B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% name allocs/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.30 ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% ``` Release note: None
craig bot
pushed a commit
that referenced
this issue
Nov 23, 2023
114772: storage: benchmark replicated lock acquisition r=nvanbenschoten a=nvanbenschoten Informs #100193. This commit adds two new microbenchmarks: - `BenchmarkMVCCCheckForAcquireLock_Pebble` - `BenchmarkMVCCAcquireLock_Pebble` These sit atop the `MVCCCheckForAcquireLock` and `MVCCAcquireLock` functions, which were introduced in #110323. Initial results: ``` name time/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 1.02µs ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 1.02µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.41µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.47µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.48µs ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.60µs ± 1% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 448ns ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 456ns ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 1.61µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 1.57µs ± 2% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.95µs ±39% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 4.75µs ± 8% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 4.52µs ± 4% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 4.01µs ± 3% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 4.02µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 2.31µs ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 2.62µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 880ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 871ns ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 2.92µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 2.91µs ± 2% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 1.46µs ± 3% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 1.71µs ± 2% name alloc/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 372B ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 336B ±35% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00B MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 352B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 713B ± 1% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 713B ± 2% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 834B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 299B ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 674B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 251B ±27% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 198B ± 1% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 811B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 810B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 279B ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 654B ± 0% name allocs/op MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 8.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.30 ±10% MVCCCheckForAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 7.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCCheckForAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 2.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 23.0 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 7.00 ± 0% MVCCAcquireLock_Pebble/batch=false/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 12.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Shared-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=false/strength=Exclusive-10 0.00 MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Shared-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=false/heldSameTxn=true/strength=Exclusive-10 22.0 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Shared-10 6.00 ± 0% MVCCAcquireLock_Pebble/batch=true/heldOtherTxn=true/heldSameTxn=false/strength=Exclusive-10 11.0 ± 0% ``` Release note: None Co-authored-by: Nathan VanBenschoten <[email protected]>
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
A-kv-transactions
Relating to MVCC and the transactional model.
A-read-committed
Related to the introduction of Read Committed
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
T-kv
KV Team
Related to #52768.
Related to #75456.
Ignoring intents, CockroachDB currently only supports the unreplicated lock durability. Consequently,
FOR UPDATE
locks are subtly best-effort; it is possible for a client to unknowingly lose a lock (violates mutual exclusion) and even still commit (violates isolation).The best-effort nature of these locks is surprising for Serailizable transactions and a correctness hazard for Snapshot and Read Committed transactions.
We should implement the
Replicated
lock strength:cockroach/pkg/kv/kvserver/concurrency/lock/locking.proto
Lines 187 to 210 in 2414bba
We should then address #100194.
Jira issue: CRDB-26577
Epic CRDB-26544
The text was updated successfully, but these errors were encountered: