-
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
kvflowcontrol: squash data race #104855
kvflowcontrol: squash data race #104855
Conversation
It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR? 🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf. |
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 r1, all commit messages.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @irfansharif)
pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go
line 110 at r1 (raw file):
// the mutex. To avoid the data race, copy out the pointers first. connections := make([]*connectedStream, len(h.mu.connections)) copy(connections, h.mu.connections)
Admit is on a performance critical path. I think we need a copy-on-write scheme instead of copy-on-read.
Fixes cockroachdb#104837. Fixes cockroachdb#105762. Release note: None
8ac33ee
to
edd1e1b
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @sumeerbhola)
pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go
line 110 at r1 (raw file):
Previously, sumeerbhola wrote…
Admit is on a performance critical path. I think we need a copy-on-write scheme instead of copy-on-read.
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.
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @irfansharif and @sumeerbhola)
pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go
line 239 at r2 (raw file):
func (h *Handle) connectStreamLocked( ctx context.Context, pos kvflowcontrolpb.RaftLogPosition, stream kvflowcontrol.Stream,
Does each connection have a unique Stream
?
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.
bors r+
Reviewable status: complete! 0 of 0 LGTMs obtained (waiting on @bananabrick and @sumeerbhola)
pkg/kv/kvserver/kvflowcontrol/kvflowhandle/kvflowhandle.go
line 239 at r2 (raw file):
Previously, bananabrick (Arjun Nair) wrote…
Does each connection have a unique
Stream
?
Yes.
👎 Rejected by code reviews |
bors r+ |
Build succeeded: |
Fixes #104837.
Fixes #105762.
Release note: None