cockroachdb / cockroachdb/cockroach

storeliveness: optimize writes

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

Description

Currently, store liveness updates the support expiration for each store on disk every time it receives a message. We batch any writes that result from the same draining of the receive queue but we don't make a further attempt to prevent the constant stream of writes.

One possible improvement is to accumulate a larger batch of messages in the receive queue, similarly to what we do for sending out messages:
https://github.com/cockroachdb/cockroach/blob/deda1ba69c1e6c3ef57377fc2d8746bc0dae27d5/pkg/kv/kvserver/storeliveness/transport.go#L357-L368

Another improvement is documented in this TODO:
https://github.com/cockroachdb/cockroach/blob/a5beea5bb2215f9851e557806d16265885670fd0/pkg/kv/kvserver/storeliveness/storelivenesspb/service.proto#L116-L136

And a third improvement is to drive heartbeats from all stores on a given node using the same timer. Doing so will naturally result in more batching over the wire, to the supporter's disk, and back over the wire. This was already implemented in https://github.com/cockroachdb/cockroach/pull/142737.

Jira issue: CRDB-47649

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.