From 134de350cc1b269b0988a2c117c324169d984cdd Mon Sep 17 00:00:00 2001 From: Arul Ajmani Date: Tue, 8 Nov 2022 10:37:55 -0500 Subject: [PATCH] kvserver: return DeprecatedLeaseHolder field in NLHEs v22.1 binaries assume that the leaseholder is unknown when logging NLHE errors if the (Deprecated)LeaseHolder field is unset -- regardless of if the Lease is set or not. We broke this logging in 0402f47 (for mixed version clusters) when we stopped shipping back leaseholder information (in favour of only shipping lease information) on NLHEs. This patch fixes this by populating the (Deprecated)LeaseHolder field when constructing NLHEs. Release note: None --- pkg/kv/kvserver/replica_range_lease.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/kv/kvserver/replica_range_lease.go b/pkg/kv/kvserver/replica_range_lease.go index 758cffab8893..0790cc9a944d 100644 --- a/pkg/kv/kvserver/replica_range_lease.go +++ b/pkg/kv/kvserver/replica_range_lease.go @@ -1036,6 +1036,10 @@ func newNotLeaseHolderError( if stillMember { err.Lease = new(roachpb.Lease) *err.Lease = l + // TODO(arul): We only need to return this for the 22.1 <-> 22.2 mixed + // version state, as v22.1 use this field to log NLHE messages. We can + // get rid of this, and the field, in v23.1. + err.DeprecatedLeaseHolder = &err.Lease.Replica } } return err