Skip to content

kvserver: don't quiesce ranges with expiration-based leases#94454

Closed
erikgrinaker wants to merge 1 commit intocockroachdb:masterfrom
erikgrinaker:expiration-lease-no-quiescence
Closed

kvserver: don't quiesce ranges with expiration-based leases#94454
erikgrinaker wants to merge 1 commit intocockroachdb:masterfrom
erikgrinaker:expiration-lease-no-quiescence

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

@erikgrinaker erikgrinaker commented Dec 30, 2022

This patch prevents quiescence with expiration-based leases, since we'll have to propose a lease extension shortly anyway.

Touches #93903.

Epic: none
Release note: None

@erikgrinaker erikgrinaker requested review from a team and nvb December 30, 2022 15:41
@erikgrinaker erikgrinaker self-assigned this Dec 30, 2022
@erikgrinaker erikgrinaker requested a review from a team as a code owner December 30, 2022 15:41
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@erikgrinaker erikgrinaker force-pushed the expiration-lease-no-quiescence branch from ba91e2a to 8a57e73 Compare December 30, 2022 15:41
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:

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


pkg/kv/kvserver/replica_raft_quiesce.go line 199 at r1 (raw file):

	hasPendingProposalsRLocked() bool
	hasPendingProposalQuotaRLocked() bool
	getLeaseRLocked() (roachpb.Lease, roachpb.Lease)

We should name these return args so that the contract here is clear without looking at the implementation.


pkg/kv/kvserver/replica_raft_quiesce.go line 280 at r1 (raw file):

		return nil, nil, false
	}
	// We don't check the proposed next lease, if any, because we always transfer

nit: should this condition live near the check of ownsValidLeaseRLocked?

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

erikgrinaker commented Dec 30, 2022

On second thought, I'm not sure we want to do this. If we add a setting to only use expiration-based leases, we probably still want to quiesce idle ranges and reacquire a new lease when unquiescing, which is likely to significantly reduce the overhead in large clusters. That implies that we won't eagerly renew expiration-based leases via Store.startLeaseRenewer(), and instead only renew leases on ranges that actually see traffic, as part of request processing. I'll be submitting a draft PR for this shortly, let's discuss there.

This patch prevents quiescence with expiration-based leases, since we'll
have to propose a lease extension shortly anyway.

Epic: none
Release note: None
@erikgrinaker erikgrinaker force-pushed the expiration-lease-no-quiescence branch from 8a57e73 to a6619a2 Compare April 1, 2023 12:53
@erikgrinaker
Copy link
Copy Markdown
Contributor Author

Closing in favor of #100430.

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