New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
kvcoord,kvclient,gossip: gossip range lease acquisition #52572
base: master
Are you sure you want to change the base?
Conversation
This still needs some testing, but I wanted to air the prototype out first to see what CI thinks of it. |
|
||
// 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 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@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
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.