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.
kvserver: don't assign closed timestamps to lease requests
Before this patch, RequestLeaseRequests was carrying the lease start time as a closed timestamp. This matched the behavior we used to have in 20.2 where the lease start time was considered to be closed by fiat. On the surface, closing a lease's start time sounds reasonable since, if the proposing replica gets the lease, it will not evaluate writes at lower timestamps. Unfortunately, there's a problem: while it's true that the replica, and the range in general, will not permit writes at timestamps below this lease's start time, it might happen that the range is in the process of merging with its left neighbor. If this range has already been Subsumed as the RHS of a merge then, after merge, the joint range will allow writes to the former RHS's key space at timestamps above the RHS's freeze start (which is below the start time the lease in question). Thus, if the lease were to close its start timestamp while subsumed, then it'd be possible for follower reads to be served before the merge finalizes at timestamps that would become un-closed after the merge. This patch fixes the bug by having lease requests no carry closed timestamps any more. Since the hazard involves subsumed ranges, we could make a distinction between brand new leases for subsumed ranges versus other brand new leases, and let the former category close the lease start time. But, for simplicity, we don't close timestamps on any lease requests. Release note: None
- Loading branch information
1 parent
9522b3f
commit 3386f1f
Showing
4 changed files
with
84 additions
and
94 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