Skip to content

Commit

Permalink
Merge pull request #86428 from cockroachdb/blathers/backport-release-…
Browse files Browse the repository at this point in the history
…22.1-86319

release-22.1: kv: improve IllegalReplicationChangeError
  • Loading branch information
irfansharif authored Aug 19, 2022
2 parents 002c0d4 + 344043d commit 62fda2b
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions pkg/kv/kvserver/replica_raft.go
Original file line number Diff line number Diff line change
Expand Up @@ -375,7 +375,7 @@ func (r *Replica) propose(
// See also https://github.com/cockroachdb/cockroach/issues/67740.
lhRemovalAllowed := r.store.cfg.Settings.Version.IsActive(
ctx, clusterversion.EnableLeaseHolderRemoval)
lhDescriptor, err := r.GetReplicaDescriptor()
lhDesc, err := r.GetReplicaDescriptor()
if err != nil {
return roachpb.NewError(err)
}
Expand All @@ -388,11 +388,11 @@ func (r *Replica) propose(
// transferred away. The previous leaseholder is a LEARNER in the target config,
// and therefore shouldn't continue holding the lease.
if err := roachpb.CheckCanReceiveLease(
lhDescriptor, proposedDesc.Replicas(), lhRemovalAllowed,
lhDesc, proposedDesc.Replicas(), lhRemovalAllowed,
); err != nil {
e := errors.Mark(errors.Wrapf(err, "received invalid ChangeReplicasTrigger %s to "+
"remove self (leaseholder); lhRemovalAllowed: %v; proposed descriptor: %v", crt,
lhRemovalAllowed, proposedDesc), errMarkInvalidReplicationChange)
e := errors.Mark(errors.Wrapf(err, "%v received invalid ChangeReplicasTrigger %s to "+
"remove self (leaseholder); lhRemovalAllowed: %v; current desc: %v; proposed desc: %v",
lhDesc, crt, lhRemovalAllowed, r.Desc(), proposedDesc), errMarkInvalidReplicationChange)
log.Errorf(p.ctx, "%v", e)
return roachpb.NewError(e)
}
Expand Down

0 comments on commit 62fda2b

Please sign in to comment.