Skip to content

kvserver: clean-up the interaction between the mergeQueue and AdminRelocateRange#75981

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
aayushshah15:20220203_cleanupAdminRelocateRangeMergeQueueInteraction
Feb 8, 2022
Merged

kvserver: clean-up the interaction between the mergeQueue and AdminRelocateRange#75981
craig[bot] merged 1 commit intocockroachdb:masterfrom
aayushshah15:20220203_cleanupAdminRelocateRangeMergeQueueInteraction

Conversation

@aayushshah15
Copy link
Copy Markdown
Contributor

This commit makes it such that the mergeQueue no longer has to take special
care to avoid a lease transfer when calling into AdminRelocateRange. This was
enabled by #75676.

Release note: None

@aayushshah15 aayushshah15 requested a review from a team as a code owner February 3, 2022 22:30
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

This works for v22.1 nodes, but does it work in a mixed-version cluster? Should we gate this logic on a cluster version?

Reviewed 1 of 1 files at r1, all commit messages.
Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @aayushshah15)

@aayushshah15 aayushshah15 force-pushed the 20220203_cleanupAdminRelocateRangeMergeQueueInteraction branch 2 times, most recently from bbfd569 to b9c86b1 Compare February 3, 2022 22:47
@aayushshah15
Copy link
Copy Markdown
Contributor Author

This works for v22.1 nodes, but does it work in a mixed-version cluster? Should we gate this logic on a cluster version?

Ah, great catch. It's kind of unfortunate though. It seems fine to keep the logic that moves the leaseholder to the front, just with the new transferLeaseToFirstVoter set to false. This gets us the same thing as version gating it, right?

Copy link
Copy Markdown
Contributor

@nvb nvb left a comment

Choose a reason for hiding this comment

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

:lgtm:

It seems fine to keep the logic that moves the leaseholder to the front, just with the new transferLeaseToFirstVoter set to false. This gets us the same thing as version gating it, right?

Good idea, I don't see any issues with this.

Reviewed all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @aayushshah15 and @nvanbenschoten)


pkg/kv/kvserver/merge_queue.go, line 340 at r2 (raw file):

		// AdminRelocateRange moves the lease to the first target in the list, so
		// sort the existing leaseholder there to leave it unchanged.
		// TODO(aayush): Remove this for 22.2.

nit: make it more clear what "this" is, along with why we're now able to make a change here.

@aayushshah15 aayushshah15 force-pushed the 20220203_cleanupAdminRelocateRangeMergeQueueInteraction branch from b9c86b1 to d56021b Compare February 7, 2022 20:14
…ateRange`

This commit makes it such that the `mergeQueue` no longer has to take special
care to avoid a lease transfer when calling into `AdminRelocateRange`. This was
enabled by cockroachdb#75676.

The preceding logic can be cleaned up in the 22.2 cycle.

Release note: None
@aayushshah15 aayushshah15 force-pushed the 20220203_cleanupAdminRelocateRangeMergeQueueInteraction branch from d56021b to 8d55acb Compare February 7, 2022 20:15
Copy link
Copy Markdown
Contributor Author

@aayushshah15 aayushshah15 left a 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: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @nvanbenschoten)


pkg/kv/kvserver/merge_queue.go, line 340 at r2 (raw file):

Previously, nvanbenschoten (Nathan VanBenschoten) wrote…

nit: make it more clear what "this" is, along with why we're now able to make a change here.

Done.

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 7, 2022

Build failed (retrying...):

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Feb 8, 2022

Build succeeded:

@craig craig bot merged commit 8ec5bf1 into cockroachdb:master Feb 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants