cockroachdb / cockroachdb/cockroach

kvserver: add cross-az and cross-region replication latency

Open
#106,499 1 comment 0 reactions 0 assignees View on GitHub
C-enhancement T-kv
Dominant language
Go
Stars
32.5k
Forks
4.1k
PR merge metrics
PR metrics pending

Description

**Is your feature request related to a problem? Please describe.**

We added replication latencies in https://github.com/cockroachdb/cockroach/pull/106094, but they're not aware of topology.

**Describe the solution you'd like**

Recently, @wenyihu6 added machinery to track topology for metrics: https://github.com/cockroachdb/cockroach/pull/105122

We should adopt the same approach for replication latency. Concretely, when a proposer's config indicates that a quorum is cross-region _or_ that the raft leader is cross-region, we should classify as cross-region, etc.

This is a bit more involved than the existing cross-region metrics and will likely involve updating some state whenever the raft leader or replication config changes, as computing this state for each proposal is likely prohibitively expensive.

**Describe alternatives you've considered**

**Additional context**

Replication latency is a great candidate for becoming an SLI we care about, so they should be powered sufficiently to get the kind of observability we need. Letting cross-region replication "crowd out" replication between local followers is not ideal.

Jira issue: CRDB-29591

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.