Skip to content

Commit

Permalink
Merge pull request #117839 from cockroachdb/blathers/backport-release…
Browse files Browse the repository at this point in the history
…-23.2-117801

release-23.2: kvserver: acquire `Replica.mu` when returning reproposal error
  • Loading branch information
erikgrinaker authored Jan 22, 2024
2 parents ed3624c + cace08b commit 6058dd8
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions pkg/kv/kvserver/replica_application_result.go
Original file line number Diff line number Diff line change
Expand Up @@ -407,13 +407,14 @@ func (r *Replica) tryReproposeWithNewLeaseIndex(ctx context.Context, origCmd *re
// The tracker wants us to forward the request timestamp, but we can't
// do that without re-evaluating, so give up. The error returned here
// will go to back to DistSender, so send something it can digest.
err := kvpb.NewNotLeaseHolderError(
r.mu.RLock()
defer r.mu.RUnlock()
return kvpb.NewNotLeaseHolderError(
*r.mu.state.Lease,
r.store.StoreID(),
r.mu.state.Desc,
"reproposal failed due to closed timestamp",
)
return err
}
// Some tests check for this log message in the trace.
log.VEventf(ctx, 2, "retry: proposalIllegalLeaseIndex")
Expand Down

0 comments on commit 6058dd8

Please sign in to comment.