Skip to content

Commit

Permalink
Merge pull request #104068 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.1-104026

release-23.1: kvserver: don't apply quota pool to lease requests
  • Loading branch information
erikgrinaker authored Jun 6, 2023
2 parents a84cfb9 + c16ff02 commit 19db4ce
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
9 changes: 8 additions & 1 deletion pkg/kv/kvserver/replica_proposal_quota.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (

"github.com/cockroachdb/cockroach/pkg/base"
"github.com/cockroachdb/cockroach/pkg/keys"
"github.com/cockroachdb/cockroach/pkg/kv/kvpb"
"github.com/cockroachdb/cockroach/pkg/roachpb"
"github.com/cockroachdb/cockroach/pkg/util/log"
"github.com/cockroachdb/cockroach/pkg/util/quotapool"
Expand All @@ -27,8 +28,14 @@ import (
)

func (r *Replica) maybeAcquireProposalQuota(
ctx context.Context, quota uint64,
ctx context.Context, ba *kvpb.BatchRequest, quota uint64,
) (*quotapool.IntAlloc, error) {
// We don't want to delay lease requests or transfers, in particular
// expiration lease extensions. These are small and latency-sensitive.
if ba.IsSingleRequestLeaseRequest() || ba.IsSingleTransferLeaseRequest() {
return nil, nil
}

r.mu.RLock()
quotaPool := r.mu.proposalQuota
desc := *r.mu.state.Desc
Expand Down
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/replica_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ func (r *Replica) evalAndPropose(
))
}
var err error
proposal.quotaAlloc, err = r.maybeAcquireProposalQuota(ctx, quotaSize)
proposal.quotaAlloc, err = r.maybeAcquireProposalQuota(ctx, ba, quotaSize)
if err != nil {
return nil, nil, "", nil, kvpb.NewError(err)
}
Expand Down

0 comments on commit 19db4ce

Please sign in to comment.