Skip to content

Commit

Permalink
Merge #64531
Browse files Browse the repository at this point in the history
64531: kvserver: fix metrics collection for rejected lease requests r=aayushshah15 a=aayushshah15

Previously, we were only updating the `leases.error` (metric measuring the
number of failed lease requests) if a lease request failed during command
evaluation. However after #55148, lease requests can be rejected by the replica
proposal buffer if there is a known raft leader that is different from the
replica requesting the lease. We were not recording such rejections as failed
lease requests in the metrics.

This commit fixes this oversight.

Release note: None

Co-authored-by: Aayush Shah <[email protected]>
  • Loading branch information
craig[bot] and aayushshah15 committed May 4, 2021
2 parents d14b256 + 713a11b commit 1db3036
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions pkg/kv/kvserver/replica_proposal_buf.go
Original file line number Diff line number Diff line change
Expand Up @@ -1136,6 +1136,7 @@ func (rp *replicaProposer) rejectProposalWithRedirectLocked(
r := (*Replica)(rp)
rangeDesc := r.descRLocked()
storeID := r.store.StoreID()
r.store.metrics.LeaseRequestErrorCount.Inc(1)
redirectRep, _ /* ok */ := rangeDesc.GetReplicaDescriptorByID(redirectTo)
speculativeLease := roachpb.Lease{
Replica: redirectRep,
Expand Down

0 comments on commit 1db3036

Please sign in to comment.