cockroachdb / cockroachdb/cockroach

kvserver: offer replica to all queues upon lease acquisition

Open
#154,946 0 comments 0 reactions 0 assignees View on GitHub
A-kv C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

See https://github.com/cockroachdb/cockroach/issues/154773.

Via @pav-kv [here](https://cockroachlabs.slack.com/archives/G01G8LK77DK/p1759841743087989):

> The problem occurs when the zone config races with a lease move:
Upon receiving a zone config update, the replica is [inserted](https://github.com/cockroachdb/cockroach/blob/881d2d7ef6bbd88beeb44636e1d1812c41b803aa/pkg/kv/kvserver/store.go#L2759) in a bunch of queues (e.g. split queue).
Some (maybe all, I haven’t checked) of these queues (e.g. [split queue](https://github.com/cockroachdb/cockroach/blob/881d2d7ef6bbd88beeb44636e1d1812c41b803aa/pkg/kv/kvserver/split_queue.go#L132)) require a lease.
So if the lease is stable, the update will be timely accounted for by the leaseholder’s queue.
But if the lease is moving, this queueing can render a no-op.
The signal is missed, and we have to wait for some next event that will trigger the queue.

Proactively adding a replica to all queues could help deflake tests and can also make the queues more responsive in production.

Jira issue: CRDB-55204

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.