kvserver: add cluster settings to log traces for slow lease transfers and splits #81152
Labels
A-kv-distribution
Relating to rebalancing and leasing.
A-kv-observability
C-enhancement
Solution expected to add code/behavior + preserve backward-compat (pg compat issues are exception)
C-performance
Perf of queries or internals. Solution not expected to change functional behavior.
O-support
Would prevent or help troubleshoot a customer escalation - bugs, missing observability/tooling, docs
P-2
Issues/test failures with a fix SLA of 3 months
T-kv
KV Team
Is your feature request related to a problem? Please describe.
In an internal escalation (https://github.com/cockroachlabs/support/issues/1533) we attributed high tail latencies to KV-internal requests like lease transfers and splits taking a while. This presented as the following:
Here we're latched behind the lease transfer request that declares a non-MVCC latch over the entire keyspace, i.e.
/M{in-ax}@0,0
. It's difficult however to go from this to an understanding of why the lease transfer request itself was taking that long? Was it waiting for inflight reads to complete? Was it something else?The same is true for split requests (also declares a non-MVCC write latch over the RHS):
Is the split waiting for long-running inflight reads to finish? Is stats evaluation taking a while?
Describe the solution you'd like
We have
sql.trace.{stmt,txn}.enable_threshold
to log instances where individual statements take longer than some threshold we're trying to filter out. We could do something similar here for internal requests (I'm specifically interested in lease transfers and splits).Additional Context
Arguably
sql.trace.{stmt,txn}.enable_threshold
aren't great given they apply to all statements/txns (we don't have something like #70614 to target specific tables/indexes, or a specific stmt fingerprint). Setting thresholds for splits/lease transfers in the same way doesn't seem that bad though given they're down in KV and (should) apply uniformly across ranges and finish in a timely manner (if they don't, say for slow stats computations, that's something we'd want to capture threshold).+cc @cockroachdb/kv-notifications.
Jira issue: CRDB-15123
The text was updated successfully, but these errors were encountered: