Skip to content

kv: don't consider follower to have pending proposal quota#73397

Open
nvb wants to merge 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/propQuotaFollowers
Open

kv: don't consider follower to have pending proposal quota#73397
nvb wants to merge 1 commit intocockroachdb:masterfrom
nvb:nvanbenschoten/propQuotaFollowers

Conversation

@nvb
Copy link
Copy Markdown
Contributor

@nvb nvb commented Dec 2, 2021

r.mu.proposalQuota is always nil on a follower, which is enforced in updateProposalQuotaRaftMuLocked. Before this change, we were considering a nil proposalQuota to have pending proposal quota. As a result, whenever a follower was ticked, it was hitting the not quiescing: replication quota outstanding branch in shouldReplicaQuiesce and not falling down to the not quiescing: not leader branch like we it expected to. This commit fixes this.

The change shouldn't have an impact on behavior, it should just fix the expectations in the code. However, I'm slightly concerned that this could reveal performance issues in shouldReplicaQuiesce. For instance, will followers now reaching the call to raftStatusRLocked be impactful? Maybe. So I don't want to backport this.

`r.mu.proposalQuota` is always nil on a follower, which is enforced in
`updateProposalQuotaRaftMuLocked`. Before this change, we were considering a nil
`proposalQuota` to have pending proposal quota. As a result, whenever a follower
was ticked, it was hitting the `not quiescing: replication quota outstanding`
branch in `shouldReplicaQuiesce` and not falling down to the `not quiescing: not
leader` branch like we it expected to. This commit fixes this.

The change shouldn't have an impact on behavior, it should just fix the
expectations in the code. However, I'm slightly concerned that this could reveal
performance issues in `shouldReplicaQuiesce`. For instance, will followers now
reaching the call to `raftStatusRLocked` be impactful? Maybe. So I don't want to
backport this.
@nvb nvb requested a review from tbg December 2, 2021 19:34
@nvb nvb requested a review from a team as a code owner December 2, 2021 19:34
@cockroach-teamcity
Copy link
Copy Markdown
Member

This change is Reviewable

Copy link
Copy Markdown
Member

@tbg tbg left a comment

Choose a reason for hiding this comment

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

:lgtm:

I assume there aren't other callers that might get confused with the changed return value for this case.

Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained

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