kvcoord,kvclient,gossip: gossip range lease acquisition#52572
Draft
knz wants to merge 1 commit intocockroachdb:masterfrom
Draft
kvcoord,kvclient,gossip: gossip range lease acquisition#52572knz wants to merge 1 commit intocockroachdb:masterfrom
knz wants to merge 1 commit intocockroachdb:masterfrom
Conversation
Member
Contributor
Author
|
This still needs some testing, but I wanted to air the prototype out first to see what CI thinks of it. |
knz
commented
Aug 10, 2020
|
|
||
| // Gossip that we have the new lease, to | ||
| // update any cached entry on other nodes. | ||
| // FIXME(andrei): do we want to move this call under the condition |
Contributor
Author
There was a problem hiding this comment.
@andreimatei @nvanbenschoten I'll take suggestions about how much sense it makes to gossip leases that are not expiration-based.
Also, is there a utility to call IsLeaseValid here? I'd say yes, because of the (unlikely) scenario where the lease was just transferred already to another node by the time we reach this point here, and we don't want this code here to race with the new leaseholder on the gossip update. Thoughts?
1a62bd6 to
00311b6
Compare
Before this patch, it was possible for a range cache to contain an outdated lease if the node with the lease was restarted or went AWOL. This patch introduces a mechanism by which the new owner of a range lease announces this ownership to other nodes via gossip. Any cached lease for that range gets updated from the gossip update if the gossiped lease is more recent than the one known. Release note (general change): CockroachDB nodes now learn more actively of range leadership transfers from other nodes. This makes query performance generally more resilient to routine node restarts, as fewer queries now get routed to an outdated or unavailable node.
00311b6 to
f94d76a
Compare
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #50199.
Before this patch, it was possible for a range cache to contain an
outdated lease if the node with the lease was restarted or went
AWOL.
This patch introduces a mechanism by which the new owner of a range
lease announces this ownership to other nodes via gossip.
Any cached lease for that range gets updated from the gossip update
if the gossiped lease is more recent than the one known.
Release note (general change): CockroachDB nodes now learn more
actively of range leadership transfers from other nodes. This makes
query performance generally more resilient to routine node restarts,
as fewer queries now get routed to an outdated or unavailable node.