Skip to content

Commit ac23f46

Browse files
committed
fixup! kvserver: prevent finished proposal from being present in proposals map
1 parent 15b1c6a commit ac23f46

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

pkg/kv/kvserver/apply/task.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,8 +272,8 @@ func (t *Task) ApplyCommittedEntries(ctx context.Context) error {
272272
}); rejectErr != nil {
273273
return rejectErr
274274
}
275-
return err
276275
}
276+
return err
277277
}
278278
}
279279
iter.Close()

pkg/kv/kvserver/replica_test.go

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8123,14 +8123,6 @@ func TestReplicaRefreshMultiple(t *testing.T) {
81238123
ba.Add(inc)
81248124
ba.Timestamp = tc.Clock().Now()
81258125

8126-
st := repl.CurrentLeaseStatus(ctx)
8127-
proposal, pErr := repl.requestToProposal(ctx, incCmdID, ba, allSpansGuard(), &st, uncertainty.Interval{})
8128-
if pErr != nil {
8129-
t.Fatal(pErr)
8130-
}
8131-
// Save this channel; it may get reset to nil before we read from it.
8132-
proposalDoneCh := proposal.doneCh
8133-
81348126
g, _, pErr := repl.concMgr.SequenceReq(ctx, nil /* guard */, concurrency.Request{
81358127
Txn: ba.Txn,
81368128
Timestamp: ba.Timestamp,
@@ -8144,6 +8136,14 @@ func TestReplicaRefreshMultiple(t *testing.T) {
81448136
}, concurrency.PessimisticEval)
81458137
require.NoError(t, pErr.GoError())
81468138

8139+
st := repl.CurrentLeaseStatus(ctx)
8140+
proposal, pErr := repl.requestToProposal(ctx, incCmdID, ba, allSpansGuard(), &st, uncertainty.Interval{})
8141+
if pErr != nil {
8142+
t.Fatal(pErr)
8143+
}
8144+
// Save this channel; it may get reset to nil before we read from it.
8145+
proposalDoneCh := proposal.doneCh
8146+
81478147
proposal.ec = endCmds{
81488148
repl: repl,
81498149
g: g,

0 commit comments

Comments
 (0)