-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
roachtest: include reads for graceful shutdown test #112926
roachtest: include reads for graceful shutdown test #112926
Conversation
cdd555e
to
0b63a73
Compare
This isn't quite ready for review, because I need to figure out if I want to tie it to the change to reordering of nodes based on locality before latency. Also, I don't really like the tangledness of the injecting of the health function into DistSender. It isn't strictly necessary, but I didn't want to do a bigger refactor since we likely want to backport this change. If there is a cleaner way to do this without splitting up the NodeLiveneess code, I would definitely do that. |
0b63a73
to
9468212
Compare
1301c0b
to
aa689b7
Compare
@nvanbenschoten I don't think https://github.com/cockroachdb/cockroach/pull/112926/files#diff-104a11712684e520f0affa95e6a053faeb713306a10f69ee99b9729cc9dd1996 is safe (changing the func pointer after construction). It maybe works, since there wouldn't have been any requests sent when this is constructed, but that is just "lucky". The alternative of refactoring the code to change the construction order is complex and not something I'd want to try and backport. Are there other good alternatives (other than a mutex around the use of this function every time)? |
aa689b7
to
3fe6804
Compare
3fe6804
to
db3a04d
Compare
@nvanbenschoten This should be ready for review. I need to look at the failure in |
7931d5c
to
84f3086
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.
Reviewed 4 of 11 files at r2, 1 of 4 files at r4, 7 of 7 files at r5.
Reviewable status:complete! 0 of 0 LGTMs obtained (waiting on @andrewbaptist, @michae2, @renatolabs, and @srosenberg)
pkg/kv/kvserver/liveness/livenesspb/liveness.go
line 274 at r5 (raw file):
case ReplicaGCQueue: return nv.isAlive() case DistSender:
The way this turned out is quite nice.
pkg/server/server.go
line 550 at r5 (raw file):
// struct. distSender.SetHealthFunc(func(id roachpb.NodeID) bool { return nodeLiveness.GetNodeVitalityFromCache(id).IsLive(livenesspb.DistSender)
Calling GetNodeVitalityFromCache
O(repl x log(repl))
times per RPC feels like it could come with a sizable performance penalty. Internally, this is acquiring the liveness cache's read lock twice, grabbing an HLC clock reading, and checking the RPC connection health (which itself acquires a few mutexes in gossip and in the RPC context).
Have we measured how expensive a single one of these calls is in a realistic setting (e.g. on a 32-core machine with 10k qps)?
Do we have any other callers of this API on the data path?
pkg/ccl/kvccl/kvfollowerreadsccl/followerreads_test.go
line 1268 at r5 (raw file):
Requests: b.Requests(), } br.Header.Timestamp = readTime
nit: can't you do b.Header.Timestamp
for this, and then still use db.Run
?
d72c164
to
e94642e
Compare
Closing this for now - the PR #114205 will temporarily supersede this. |
e94642e
to
0f178ae
Compare
The only remaining part of this was the change to the roachtest to include follower reads in the testing. I'm changing to @kvoli as he has worked on this test before. |
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 1 of 1 files at r10, 25 of 25 files at r11, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @andrewbaptist)
-- commits
line 4 at r11:
nit: reference the name of the test, since it is changed here.
-- commits
line 12 at r11:
nit: rm empty line.
pkg/cmd/roachtest/tests/kv.go
line 622 at r11 (raw file):
case <-ctx.Done(): return case <-time.After(2 * time.Minute):
Q: Why the wait increase?
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.
TFTR!
Reviewable status:
complete! 1 of 0 LGTMs obtained (waiting on @kvoli and @nvanbenschoten)
Previously, kvoli (Austen) wrote…
nit: reference the name of the test, since it is changed here.
Done
Previously, kvoli (Austen) wrote…
nit: rm empty line.
Done
pkg/cmd/roachtest/tests/kv.go
line 622 at r11 (raw file):
Previously, kvoli (Austen) wrote…
Q: Why the wait increase?
This was to make sure we capture any "latent" impacts of the restart. Previously it was restarting before the system was fully healthy (not all caught up and leases rebalanced). A longer wait here prevents this.
pkg/ccl/kvccl/kvfollowerreadsccl/followerreads_test.go
line 1268 at r5 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
nit: can't you do
b.Header.Timestamp
for this, and then still usedb.Run
?
Thanks - changed.
pkg/kv/kvserver/liveness/livenesspb/liveness.go
line 274 at r5 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
The way this turned out is quite nice.
👍
pkg/server/server.go
line 550 at r5 (raw file):
Previously, nvanbenschoten (Nathan VanBenschoten) wrote…
Calling
GetNodeVitalityFromCache
O(repl x log(repl))
times per RPC feels like it could come with a sizable performance penalty. Internally, this is acquiring the liveness cache's read lock twice, grabbing an HLC clock reading, and checking the RPC connection health (which itself acquires a few mutexes in gossip and in the RPC context).Have we measured how expensive a single one of these calls is in a realistic setting (e.g. on a 32-core machine with 10k qps)?
Do we have any other callers of this API on the data path?
This was pulled into the other PR - but now this is cached. It turned out the most expensive part of this was the ConnHealth
which is done twice without the other changes.
0f178ae
to
f3da938
Compare
f3da938
to
417d149
Compare
Small changes to the test kv/gracefuldraining/nodes=3. 1) Increase the cluster size from 3 to 6. 2) Introduce both reads and follower reads. 3) Increase the length of the test run and the time between starts/stops. 4) Include both reads and writes when measuring QPS. Epic: none Release note: None
417d149
to
80bb000
Compare
bors r=kvoli |
Small changes to the test:
starts/stops.
Epic: none
Release note: None