kvserver: log a trace for slow splits#120943
Conversation
|
Looking for feedback on:
|
2s sounds reasonable. Re-using something similar to the replicate queue would be a bit rough to define an expected rate based off the range size given different hardware/conditions. In comparison, the rate for the replicate queue is mostly bounded by the configured snapshot rate.
I didn't take a look at other queues but if this is doable without too much added effort, then that sounds good. We wouldn't want to trace across multiple retries, since a trace on the last retry would be sufficient. |
I looked at the various queues again. I think if we want to add optional tracing for slow queue processing in the base queue, we'd wrap the timing and tracing logic around this call to
Edited to add: the refactor in option 2 doesn't seem particularly easy because the internal processing functions (e.g. |
|
I'd prefer to leave as is for now, unless we won't be backporting this to the 24.1 release branch. |
kvoli
left a comment
There was a problem hiding this comment.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @miraradeva)
pkg/kv/kvserver/client_split_test.go line 1070 at r1 (raw file):
// TestStoreRangeSplitWithTracing tests that the split queue logs traces for // slow splits. func TestStoreRangeSplitWithTracing(t *testing.T) {
Nice test!
pkg/kv/kvserver/client_split_test.go line 1074 at r1 (raw file):
defer log.Scope(t).Close(t) l := log.ScopeWithoutShowLogs(t) _ = log.SetVModule("split_queue=2")
nit: change this to split_queue=1 to match the expensive log check exactly inprocessAttemptWithTracing.
This change enables logging a trace of a split request if it exceeds a certain duration. The duration is controlled by a new cluster setting: `kv.split.slow_split_tracing_threshold`, which defaults to 2s. Fixes: cockroachdb#81152 Release note: None
b69bfdf to
6f9b7ec
Compare
|
bors r=kvoli |
This change enables logging a trace of a split request if it exceeds a certain duration. The duration is controlled by a new cluster setting:
kv.split.slow_split_tracing_threshold, which defaults to 2s.Fixes: #81152
Release note: None