Skip to content

Commit

Permalink
kvserver: remove unnecessary condition
Browse files Browse the repository at this point in the history
The `!reproposal` condition already captures whether this is the
first time the proposal is seen in that method. The other condition
added only fear, uncertainty, and doubt.

Epic: CRDB-25287
Release note: None
  • Loading branch information
tbg committed Jul 10, 2023
1 parent 0207c61 commit 6cf66d3
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions pkg/kv/kvserver/replica_proposal_buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -603,13 +603,7 @@ func (b *propBuf) FlushLockedWithRaftGroup(

// We don't want deduct flow tokens for reproposed commands, and of
// course for proposals that didn't integrate with kvflowcontrol.
//
// TODO(tbg): with useReproposalsV2, we make new proposals in
// tryReproposeWithNewLeaseIndex that will have createdAtTicks ==
// proposedAtTicks. They will have !reproposal but raftAdmissionMeta=nil.
// What is createdAtTicks==proposedAtTicks even good for? The !reproposal
// condition already handles the case in which it isn't.
shouldAdmit := p.createdAtTicks == p.proposedAtTicks && !reproposal && p.raftAdmissionMeta != nil
shouldAdmit := !reproposal && p.raftAdmissionMeta != nil
if !shouldAdmit {
admitHandles = append(admitHandles, admitEntHandle{})
} else {
Expand Down

0 comments on commit 6cf66d3

Please sign in to comment.