-
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
storage: parallelize processing of Replica.handleRaftReady #7531
storage: parallelize processing of Replica.handleRaftReady #7531
Conversation
panic(err) // TODO(bdarnell) | ||
} | ||
sem.acquire() | ||
go func(r *Replica) { |
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.
If you're avoiding the stopper on purpose, a comment wouldn't hurt as to not make this look like an omission.
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.
Well, we weren't previously checking the stopper in this code, but instead processing all of the replicas. I'm not sure why would need to check the stopper with this change.
LGTM, but need to make sure @bdarnell takes a look when he comes back. |
Reviewed 1 of 1 files at r1. storage/store.go, line 91 [r1] (raw file):
is this a useful comment? storage/store.go, line 114 [r1] (raw file):
i don't think it's crucial, but this can be removed if you invert the implementations of acquire and release. By the way, wouldn't this be faster with atomic operations? asking for a friend. Comments from Reviewable |
437185e
to
ed0937c
Compare
Review status: all files reviewed at latest revision, 3 unresolved discussions, all commit checks successful. storage/store.go, line 91 [r1] (raw file):
|
Reviewed 1 of 1 files at r2. storage/store.go, line 91 [r1] (raw file):
|
Improves the performance of `block_writer` inserting 1m rows from 250s to 195s. We default concurrency per store to `2*num-cpu`. There wasn't any noticeable harm or benefit to allowing more concurrency than that, but it seems prudent to provide some limit. Fixes cockroachdb#7522.
ed0937c
to
5b04a8f
Compare
Review status: 0 of 1 files reviewed at latest revision, 2 unresolved discussions, some commit checks pending. storage/store.go, line 91 [r1] (raw file):
|
Reviewed 1 of 1 files at r3. Comments from Reviewable |
That was easier than I was expecting; hope we're not missing something. (My more complex plan was to avoid the WaitGroup and give each Replica its own goroutine that wouldn't block the processRaft goroutine. But this looks like it may give us most of the benefit more easily) Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. storage/store.go, line 2193 [r1] (raw file):
|
Review status: all files reviewed at latest revision, 2 unresolved discussions, all commit checks successful. storage/store.go, line 2193 [r1] (raw file):
|
Improves the performance of
block_writer
inserting 1m rows from 250sto 195s. We default concurrency per store to
2*num-cpu
. There wasn'tany noticeable harm or benefit to allowing more concurrency than that,
but it seems prudent to provide some limit.
Fixes #7522.
This change is