forked from cockroachdb/cockroach
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
kv: bump timestamp cache when resolving replicated locks
This patch teaches ResolveIntent and ResolveIntentRange requests to bump the timestamp cache if any replicated shared/exclusive locks were resolved by them (if the transaction that held the lock was committed). In all other cases (only unreplicated locks, no shared or exclusive locks, or aborted lock holder transaction) the timestamp cache is not bumped. The handling of ResolveIntentRange requests deserves some words -- for these, we choose to bump the timestamp cache over the entire keyspan they operated over if there's a single replicated {shared, exclusive} lock. This means we're losing fidelity over specific keys that had point locks on them; we choose this approach instead of trying to plumb high fidelity information back up for simplicity and to avoid cases where the response message to a ResolveIntentRange request is significantly larger than the request itself. The downside of this is that we bump the timestamp cache over keys that may not have been locked. In practice, we don't think this will be any more impactful than the other downsides of ranged intent resolution, like grabbing a write latch across keys that weren't locked. Lastly, it's worth noting that `EndTxn` requests also resolve local locks. As such, any replicated {shared, exclusive} locks resolved by a EndTxn request also need to be handled in similar fashion. This patch does not do that -- we leave that to an subsequent patch, at which point the linked issue can be closed. Informs cockroachdb#111536 Release note: None
- Loading branch information
1 parent
0fbb976
commit 7702ff8
Showing
6 changed files
with
313 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters