-
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: Run one ScanInterleavedIntents per store concurrently #69607
Conversation
4a0035c
to
574b610
Compare
I think we might actually want to make this setting-tunable. Like, these are basically like ExportRequests, right? They both have to scan a large span and look for intents. You could potentially just copy/paste the ConcurrentExportRequests limiter, adding to the limiters field that is already an attribute of each store, to avoid needing to keep your own map, and so you'd also have a Settings.SV around to setup the on-change hook. I dunno. |
574b610
to
76d57c2
Compare
Thanks for the review! Yep, making it settings-tunable is probably a good idea. That way we can stuff the 4x node multiplier default into the cluster setting and have that drive that multiplier instead. I'll make that change shortly. Addressed the other points. |
76d57c2
to
94d7ddf
Compare
Done. Slight update to last comment: I didn't put the 4x fan-out-time node multiplier factor in the setting, but rather the 1x store multiplier in it. That's less useful as there's no easy way to "slow it down" by reducing it any lower than 1 (0 would effectively stop rate limiting as the limiter will just return an error upon |
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.
Reviewed 6 of 8 files at r1, 4 of 4 files at r4, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @itsbilal)
pkg/kv/kvserver/replica_send.go, line 288 at r4 (raw file):
reservation, err := r.store.limiters.ConcurrentScanInterleavedIntents.Begin(ctx) if err != nil { return nil
why are we ignoring the error?
pkg/kv/kvserver/replica_send.go, line 355 at r4 (raw file):
// Handle any request-specific pre-latch throttles. if res := r.maybeThrottleRequestPreLatch(ctx, ba); res != nil {
Why do this here instead of earlier in Store.Send
in maybeThrottleBatch
-- it fits well with the other logic there?
Currently, lock table migration related requests (Barrier, ScanInterleavedIntents, PushTxn, ResolveIntent), are only run with a concurrency of 4 regardless of the size of the cluster. This change increases that to 4 * numNodes, and adds a new mechanism to limit the ScanInterleavedIntents on the receiver side to 1 per store. This throttle is applied before latches are grabbed. Only ScanInterleavedIntents needs to be rate-limited as it's by far the heaviest component in the separated intents migrations. Release justification: Category 2, low-risk update to new functionality Release note: None.
94d7ddf
to
9e720b6
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.
Dismissed @sumeerbhola from 2 discussions.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @dt, @itsbilal, and @sumeerbhola)
pkg/kv/kvserver/replica_send.go, line 292 at r1 (raw file):
Previously, dt (David Taylor) wrote…
2¢: I donno why I'm slightly uneasy about the panic, as well as the map lookup, plus being getOrCreate here (we would never want to create, then release). I might vote to have maybeThrottle just return a limiter.Reservation and if the caller gets a non-nil reservation, they have to defer releasing it.
Done.
pkg/kv/kvserver/replica_send.go, line 288 at r4 (raw file):
Previously, sumeerbhola wrote…
why are we ignoring the error?
Done.
pkg/kv/kvserver/replica_send.go, line 355 at r4 (raw file):
Previously, sumeerbhola wrote…
Why do this here instead of earlier in
Store.Send
inmaybeThrottleBatch
-- it fits well with the other logic there?
Done. I had missed that as I was looking at replica_send.go and not store_send.go.
pkg/kv/kvserver/batcheval/cmd_scan_interleaved_intents.go, line 25 at r1 (raw file):
Previously, dt (David Taylor) wrote…
I think we like this thing better (that sem isn't fair) https://github.com/cockroachdb/cockroach/blob/master/pkg/util/limit/limiter.go#L47
Done.
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.
Reviewed 3 of 3 files at r5, all commit messages.
Reviewable status: complete! 1 of 0 LGTMs obtained (waiting on @dt)
TFTRs! bors r=dt |
Build succeeded: |
Currently, lock table migration related requests (Barrier,
ScanInterleavedIntents, PushTxn, ResolveIntent), are only run
with a concurrency of 4 regardless of the size of the cluster.
This change increases that to 4 * numNodes, and adds a new
mechanism to limit the ScanInterleavedIntents on the receiver
side to 1 per store. This throttle is applied before latches
are grabbed. Only ScanInterleavedIntents needs to be
rate-limited as it's by far the heaviest component in
the separated intents migrations.
Release justification: Category 2, low-risk update to new functionality
Release note: None.