-
Notifications
You must be signed in to change notification settings - Fork 4k
rac2: specify lock ordering, and add ReplicaSet #128706
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
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. |
kvoli
left a comment
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.
- see nit on using
roachpb.ReplicaSet, I don't feel strongly enough to block on it but it'd be worthwhile writing down why we don't use it.
Reviewed 2 of 2 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @pav-kv and @sumeerbhola)
pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go line 47 at r1 (raw file):
// // Requires replica.raftMu to be held. SetReplicasRaftMuLocked(ctx context.Context, replicas ReplicaSet) error
nit: do we need to use a new replica set type, instead of using the existing roachpb.ReplicaSet? It makes sense to use it internally, within the datastructure if we want map accesses but as an argument it might be nicer to use roachpb.ReplicaSet, which is a wrapped slice and used in many other parts of KV for similar purposes.
sumeerbhola
left a comment
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! 1 of 0 LGTMs obtained (waiting on @kvoli and @pav-kv)
pkg/kv/kvserver/kvflowcontrol/rac2/range_controller.go line 47 at r1 (raw file):
Previously, kvoli (Austen) wrote…
nit: do we need to use a new replica set type, instead of using the existing
roachpb.ReplicaSet? It makes sense to use it internally, within the datastructure if we want map accesses but as an argument it might be nicer to useroachpb.ReplicaSet, which is a wrapped slice and used in many other parts of KV for similar purposes.
The replicaRACv2Integration uses a map for lookups by ReplicaID. There is also one case of such lookups in RangeControllerImpl. These sets are only replaced with a new map (never updated), so it is convenient to share.
And it reduces unnecessary code: in replicaRACv2Integration it would need to produce a map for its internal use and produce a roachpb.ReplicaSet for RangeController, which would then proceed to convert the roachpb.ReplicaSet to a map.
Informs cockroachdb#128308 Epic: CRDB-37515 Release note: None
7941334 to
1ddc364
Compare
sumeerbhola
left a comment
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!
I tweaked the commentary about ReplicaSet and SetReplicasRaftMuLocked.
Reviewable status:
complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @kvoli and @pav-kv)
kvoli
left a comment
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 r2, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @pav-kv)
|
bors r=kvoli |
Informs #128308
Epic: CRDB-37515
Release note: None