kvserver: single node unquiesces on every tick #63295
Labels
A-kv-replication
Relating to Raft, consensus, and coordination.
C-bug
Code not up to spec/doc, specs & docs deemed correct. Solution expected to change code/behavior.
Describe the problem
On a single-node cluster, user ranges with moderate traffic (~10qps) emit ~5 empty raft entries per second because this code
cockroach/pkg/kv/kvserver/replica_raft_quiesce.go
Lines 80 to 82 in fa32402
fires erroneously on every raft tick (200ms). This could affect single-node peak performance.
To Reproduce
Over a 60s interval, I'm counting (only for r37, the one getting the load) 291 instances, i.e. ~5 per second.
./cockroach debug raft-log cockroach-data/ 37
shows these empty entries and also tells me that the term remains stable, i.e. these entries are not emitted as a result of raft spuriously re-electing itself as a leader.I then went and looked for places where we propose empty commands, and voila:
cockroach/pkg/kv/kvserver/replica_raft_quiesce.go
Lines 80 to 82 in fa32402
I verified that this fires just before each empty command, i.e. it's conclusively the origin.
Environment:
master
branch at 2c50690Additional context
Stumbled upon this in #62791
Jira issue: CRDB-6512
Epic CRDB-25209
The text was updated successfully, but these errors were encountered: