-
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
kvserver: maybe delay snapshot ingestion #77491
Conversation
cfcecc7
to
bd20b1a
Compare
3e72471
to
2547c79
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thanks!
Previously, upon receiving a snapshot the store would not check store health before applying the snapshot. This can result in overload in the case where the store is already unhealthy. This patch adds a pre-ingestion check to avoid overloading the store. The backpressure applied is configurable with `rocksdb.ingest_backpressure.l0_file_count_threshold` and `rocksdb.ingest_backpressure.max_delay`. To disable snapshot backpressure, such that no delay is applied, the cluster settings can be configured to: `SET CLUSTER SETTING rocksdb.ingest_backpressure.l0_file_count_threshold = 99999999` or `SET CLUSTER SETTING rocksdb.ingest_backpressure.max_delay = 0` touches: cockroachdb#74694 Release justification: bug fixes Release note ops change: Delay snapshot ingestion when the store is unhealthy. The cumulative time that requests are delayed is tracked by `range.snapshots.delay.total`. This backpressure is configurable with `rocksdb.ingest_backpressure.l0_file_count_threshold` and `rocksdb.ingest_backpressure.max_delay`.
re 22.1 release - @nvanbenschoten agreed that we won't aim to merge this into this release, due to potential fallout this late. I'm removing the release justification accordingly. |
To elaborate further - the concern is that this change doesn't discriminate upon the type of snapshot. There was a discussion of separate FIFO semaphores, which queue snapshots. The ingestion delay could reside in the less critical snapshot semaphore, however not the more critical. This raises an issue regarding ticketing between them, to limit concurrency - which is open or tbd and makes this approach less desirable. |
@nvanbenschoten @lunevalex I'd like to understand how this PR relates to the discussion we are having in https://docs.google.com/document/d/1_YtzvlMg3IKcM5G_dvqsGyOP465GlFEVr16GPBBBxQk/edit?disco=AAAAXWDzV5s
|
@sumeerbhola I agree with your rationale. This is in a sensitive-enough code area that I don't think we would want to backport this change. That's especially true because none of the support issues that have motivated this issue ended up being due to snapshots.
Do you think this would allow us to get rid of the
100%. In the past, we've struggled to experimentally validate policy changes at this level. We'll need to do better if we want to add more sophistication here. |
Previously, upon receiving a snapshot the store would not check store
health before applying the snapshot. This can result in overload in the
case where the store is already unhealthy. This patch adds a
pre-ingestion check to avoid overloading the store.
The backpressure applied is configurable with
rocksdb.ingest_backpressure.l0_file_count_threshold
androcksdb.ingest_backpressure.max_delay
. To disable snapshotbackpressure, such that no delay is applied, the cluster settings can be
configured to:
SET CLUSTER SETTING rocksdb.ingest_backpressure.l0_file_count_threshold = 99999999
or
SET CLUSTER SETTING rocksdb.ingest_backpressure.max_delay = 0
touches: #74694
Release note ops change: Delay snapshot ingestion when the store is
unhealthy. The cumulative time that requests are delayed is tracked by
range.snapshots.delay.total
. This backpressure is configurable withrocksdb.ingest_backpressure.l0_file_count_threshold
androcksdb.ingest_backpressure.max_delay
.