Skip to content

Commit

Permalink
storage: check for conflicting replicated locks in mvccPutInternal
Browse files Browse the repository at this point in the history
Fixes cockroachdb#109647.
Informs cockroachdb#100193.

This commit uses the `lockTableKeyScanner` introduced in cockroachdb#110323 to scan
for conflicting replicated locks at the same time as we can for intents
(the writer's or others') when performing mutations in mvccPutInternal.
In doing so, the commit removes use of `intentInterleavingIter` on the
mutation path, opting for the explicit scan of the lock table instead.

Use of the lockTableKeyScanner to both check for conflicting locks and
to scan for intents ensures that in the common case where there are no
locks on a key, we only perform one (prefix) seek. This should avoid any
regression. I'll collect some benchmark results to verify that this
reasoning holds and that this does not cause a performance regression
for write-heavy workloads.

Release note: None
  • Loading branch information
nvanbenschoten committed Sep 12, 2023
1 parent 6426a0c commit 467499d
Show file tree
Hide file tree
Showing 3 changed files with 319 additions and 52 deletions.
Loading

0 comments on commit 467499d

Please sign in to comment.