kv: don't consider follower to have pending proposal quota#73397
Open
nvb wants to merge 1 commit intocockroachdb:masterfrom
Open
kv: don't consider follower to have pending proposal quota#73397nvb wants to merge 1 commit intocockroachdb:masterfrom
nvb wants to merge 1 commit intocockroachdb:masterfrom
Conversation
`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.
Member
tbg
approved these changes
Dec 3, 2021
Member
tbg
left a comment
There was a problem hiding this comment.
I assume there aren't other callers that might get confused with the changed return value for this case.
Reviewable status:
complete! 1 of 0 LGTMs obtained
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
r.mu.proposalQuotais always nil on a follower, which is enforced inupdateProposalQuotaRaftMuLocked. Before this change, we were considering a nilproposalQuotato have pending proposal quota. As a result, whenever a follower was ticked, it was hitting thenot quiescing: replication quota outstandingbranch inshouldReplicaQuiesceand not falling down to thenot quiescing: not leaderbranch 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 toraftStatusRLockedbe impactful? Maybe. So I don't want to backport this.