cockroachdb / cockroach

CockroachDB — the cloud native, distributed SQL database designed for high availability, effortless scale, and control over data placement.
https://www.cockroachlabs.com
Other
30.03k stars 3.79k forks source link

kvflowcontrol: leaseholder not leader doesn't admit via store work queue #130948

Open kvoli opened 1 month ago

kvoli commented 1 month ago

When a leaseholder replica doesn't hold the lease, replication flow control v1 skips admission via replication flow control (here) because the leader maintains flow token state.

However, in replication flow control v1, we also skip admitting via the StoreWorkQueue -- so no AC backpressure is applied.

Jira issue: CRDB-42303

aadityasondhi commented 1 week ago

Discussed internally. This is a rare bug but a quick fix. We will pick this up once other higher priority items are complete. The AdmitKVWork function in general lacks explicit tests, we should fix that too.