-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
spanconfig: add mechanism to alter the buffer limit used by the KVSubscriber #77539
Comments
We use the underlying rangefeedcache library at various places now, not just the KVSubscriber. Do we want knobs for each usage? Or are the other initial table scans not as worrying?
Given the KVSubscriber is a per-store thing, probably we want an the cluster setting. Changing out the env-var cluster wide would require a full cluster restart -- not the best during incidents that want such a thing. |
Let's set out to make the buffer size dynamic in the rangefeedcache library. |
I'm still planning to make this limit dynamic and backport, but with #77687 this issue is no longer a release blocker. Concretely: running into buffer limits during the initial scan is unrecoverable, which #78148 fixes. Running into buffer limits during the incremental phase is entirely recoverable with a retry, which this issue would help reduce the occurrence of in practice. |
We have marked this issue as stale because it has been inactive for |
Is your feature request related to a problem? Please describe.
The KVSubscriber uses a
rangefeedcache.Watcher
oversystem.span_configurations
to construct and incrementally maintain in-memory span configuration state. We limit this watcher's buffer size statically, here:cockroach/pkg/server/server.go
Lines 547 to 555 in 2867db0
We coarsely estimate each row in
system.span_configurations
to be 5KB. Given this, limiting the buffer size to 1MB seems sane for incremental updates. However, this limit is also enforced when performing an initial scan of the table as well, which is no good. We'll have a separate issue to fix that, but independent of it, it still seems prudent to have a mechanism to be able to alter the 1MB limit for the KVSubscriber's buffer in the wild as an escape hatch.Describe the solution you'd like
Let's introduce an env var that dictates the buffer size to use when initializing the KVSubscriber. We could introduce a cluster setting as well, though that might be a bit more involved.
cc @ajwerner @irfansharif
Jira issue: CRDB-13643
The text was updated successfully, but these errors were encountered: