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/batcheval: restore lease if transfer fails
Before evaluating a TransferLeaseRequest, we revoke the existing lease. This is needed so that further reads are not permitted before the new lease takes effect without being captured in the timestamp cache summary carried by the transfer. This patch makes it so that we restore the original lease if the evaluation of the transfer fails(*), as there doesn't seem to be any reason to force the replica to acquire a new lease in that case. This patch is strictly about evaluation failing, and not about failures or ambiguity during application of the lease transfer Raft command. (*) It's not common for the evaluation of a transfer to fail. We see something going wrong with a transfer (either with the evaluation or with the proposal) in cockroachdb#83687. Evaluation fails on inconsistent next leases, which I think can happen under transfer races. Release note: None
- Loading branch information
1 parent
2b2c6e3
commit ea6b276
Showing
5 changed files
with
90 additions
and
9 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