From 8fbe6fc3fc92acb6bd476b3e02aac7e49f65ff35 Mon Sep 17 00:00:00 2001 From: Andrei Matei Date: Tue, 16 Feb 2021 15:11:57 -0500 Subject: [PATCH] kvserver: initialize propBuf LAI tracking The initialization of the LAI tracking in the proposal buffer seems pretty lacking (see #60625). This patch adds initialization of propBuf.liBase at propBuf.Init() time, which is irrelevant for production, but will help future tests which will surely want the a propBuf's first assigned LAIs to have some relationship to the replica state. Release note: None --- pkg/kv/kvserver/replica_proposal_buf.go | 1 + 1 file changed, 1 insertion(+) diff --git a/pkg/kv/kvserver/replica_proposal_buf.go b/pkg/kv/kvserver/replica_proposal_buf.go index e5a483903139..f5b31c1db79a 100644 --- a/pkg/kv/kvserver/replica_proposal_buf.go +++ b/pkg/kv/kvserver/replica_proposal_buf.go @@ -208,6 +208,7 @@ type proposerRaft interface { func (b *propBuf) Init(p proposer) { b.p = p b.full.L = p.rlocker() + b.liBase = p.leaseAppliedIndex() } // Len returns the number of proposals currently in the buffer.