Skip to content

kvserver: don't consider followers to have pending proposal quota#94558

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:followers-no-pending-proposal-quota
Jan 3, 2023
Merged

kvserver: don't consider followers to have pending proposal quota#94558
craig[bot] merged 1 commit intocockroachdb:masterfrom
erikgrinaker:followers-no-pending-proposal-quota

Conversation

@erikgrinaker
Copy link
Copy Markdown
Contributor

Replica.hasPendingProposalQuotaRLocked() considered a replica with proposalQuota == nil to have pending proposal quota, which in turn prevented quiescence. This condition is only possible on followers, which won't be able to quiesce anyway since we explicitly check for leadership. This can be misleading in vmodule logs, which claim "not quiescing: replication quota outstanding" on all followers.

This patch instead considers followers to have no pending proposal quota, thus vmodule logs will emit the more accurate "not quiescing: not leader".

This may lead to higher CPU usage on followers, because we now fall through to a raftStatusRLocked check which is more expensive. This should be optimized separately.

Touches #94457.

Epic: none
Release note: None

`Replica.hasPendingProposalQuotaRLocked()` considered a replica with
`proposalQuota == nil` to have pending proposal quota, which in turn
prevented quiescence. This condition is only possible on followers,
which won't be able to quiesce anyway since we explicitly check for
leadership. This can be misleading in vmodule logs, which claim "not
quiescing: replication quota outstanding" on all followers.

This patch instead considers followers to have no pending proposal
quota, thus vmodule logs will emit the more accurate "not quiescing: not
leader".

This may lead to higher CPU usage on followers, because we now fall
through to a `raftStatusRLocked` check which is more expensive. This
should be optimized separately.

Epic: none
Release note: None
@erikgrinaker erikgrinaker requested review from a team, nvb and tbg December 31, 2022 14:28
@erikgrinaker erikgrinaker self-assigned this Dec 31, 2022
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

erikgrinaker commented Jan 2, 2023

Much of the additional cost here is reduced by #94594.

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

#94595 eliminates the performance penalty of this change.

@erikgrinaker
Copy link
Copy Markdown
Contributor Author

bors r+

@craig
Copy link
Copy Markdown
Contributor

craig bot commented Jan 3, 2023

Build succeeded:

@craig craig bot merged commit 2376029 into cockroachdb:master Jan 3, 2023
@erikgrinaker erikgrinaker deleted the followers-no-pending-proposal-quota branch January 3, 2023 13:00
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