-
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
mma: misc small cleanups #141756
mma: misc small cleanups #141756
Conversation
Informs cockroachdb#103320 Epic: CRDB-25222 Release note: None
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.
Reviewable status:
complete! 0 of 0 LGTMs obtained (waiting on @kvoli)
pkg/kv/kvserver/allocator/mma/load.go
line 131 at r1 (raw file):
// LSM on the store is getting overloaded, whether it is because of disk // bandwidth being reached or some other resource bottleneck (compactions // not keeping up), the store can set this to a synthesized value that
this is somewhat bogus. We can't have some stores provide a capacity for a loadDimension and others not provide it. For now, just removed this.
pkg/kv/kvserver/allocator/mma/load.go
line 209 at r1 (raw file):
func (mss *meansForStoreSet) clear() { for k := range mss.storeSummaries { delete(mss.storeSummaries, k)
either clear
did not exist, or I didn't know about it.
pkg/kv/kvserver/allocator/mma/load.go
line 419 at r1 (raw file):
// The capacity may be unknownCapacity. Even if we have a known capacity, we // may want to consider how far we are away from mean. The mean isn't very // useful when there are heterogeneous nodeLoad. It also does not help when
This was unnecessary in that we don't do this calculation in the context of a global mean. We do this from the meansMemo
in the context of a particular set.
pkg/kv/kvserver/allocator/mma/messages.go
line 87 at r1 (raw file):
// node in a distributed allocator, since there are also other updates via // AdjustPendingChangesDisposition. We can start with only full state // updates, and add diff support later.
There are no diff updates.
pkg/kv/kvserver/allocator/mma/cluster_state.go
line 99 at r1 (raw file):
// information received from the leaseholder, this value is set, so that // even if the store with a replica affected by this pending change does not // tell us about the enactment, we can garbage collect this change.
the store with the replica will never tell us about the enactment. The message.go changes are not in this PR, but decided to fix this anyway.
pkg/kv/kvserver/allocator/mma/cluster_state.go
line 315 at r1 (raw file):
// // Unilateral removal from loadPendingChanges happens if the load reported // by the store shows that this pending change has been enacted. We no
ditto
pkg/kv/kvserver/allocator/mma/cluster_state.go
line 442 at r1 (raw file):
// lastHeardTime is the latest time when this range was heard about from any // store, via storeLeaseholderMsg or storeLoadMsg. Despite the best-effort
Since this is a distributed allocator and the storeLeaseholderMsg is local, there is no lossiness there and we can get rid of this.
pkg/kv/kvserver/allocator/mma/constraint_matcher.go
line 173 at r1 (raw file):
*storeSet = (*storeSet)[:0] return }
This was just unnecessary special casing that is already handled below.
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 4 files at r1, all commit messages.
Reviewable status:complete! 1 of 0 LGTMs obtained (waiting on @sumeerbhola)
pkg/kv/kvserver/allocator/mma/cluster_state.go
line 442 at r1 (raw file):
Previously, sumeerbhola wrote…
Since this is a distributed allocator and the storeLeaseholderMsg is local, there is no lossiness there and we can get rid of this.
sgtm.
pkg/kv/kvserver/allocator/mma/load.go
line 209 at r1 (raw file):
Previously, sumeerbhola wrote…
either
clear
did not exist, or I didn't know about it.
😄
TFTR! |
bors r=kvoli |
Informs #103320
Epic: CRDB-25222
Release note: None