Skip to content
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

Merged
merged 1 commit into from
Feb 20, 2025
Merged

mma: misc small cleanups #141756

merged 1 commit into from
Feb 20, 2025

Conversation

sumeerbhola
Copy link
Collaborator

Informs #103320

Epic: CRDB-25222

Release note: None

Informs cockroachdb#103320

Epic: CRDB-25222

Release note: None
@sumeerbhola sumeerbhola requested a review from kvoli February 19, 2025 23:55
@sumeerbhola sumeerbhola requested a review from a team as a code owner February 19, 2025 23:56
Copy link

blathers-crl bot commented Feb 19, 2025

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.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

Copy link
Collaborator Author

@sumeerbhola sumeerbhola left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewable status: :shipit: 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.

Copy link
Collaborator

@kvoli kvoli left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:lgtm:

Reviewed 4 of 4 files at r1, all commit messages.
Reviewable status: :shipit: 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.

😄

@sumeerbhola
Copy link
Collaborator Author

TFTR!

@sumeerbhola
Copy link
Collaborator Author

bors r=kvoli

@craig craig bot merged commit ef277cd into cockroachdb:master Feb 20, 2025
24 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants