Skip to content

Commit

Permalink
fixup! kvserver: prevent finished proposal from being present in prop…
Browse files Browse the repository at this point in the history
…osals map
  • Loading branch information
tbg committed Feb 6, 2023
1 parent 15b1c6a commit ac23f46
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pkg/kv/kvserver/apply/task.go
Original file line number Diff line number Diff line change
Expand Up @@ -272,8 +272,8 @@ func (t *Task) ApplyCommittedEntries(ctx context.Context) error {
}); rejectErr != nil {
return rejectErr
}
return err
}
return err
}
}
iter.Close()
Expand Down
16 changes: 8 additions & 8 deletions pkg/kv/kvserver/replica_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -8123,14 +8123,6 @@ func TestReplicaRefreshMultiple(t *testing.T) {
ba.Add(inc)
ba.Timestamp = tc.Clock().Now()

st := repl.CurrentLeaseStatus(ctx)
proposal, pErr := repl.requestToProposal(ctx, incCmdID, ba, allSpansGuard(), &st, uncertainty.Interval{})
if pErr != nil {
t.Fatal(pErr)
}
// Save this channel; it may get reset to nil before we read from it.
proposalDoneCh := proposal.doneCh

g, _, pErr := repl.concMgr.SequenceReq(ctx, nil /* guard */, concurrency.Request{
Txn: ba.Txn,
Timestamp: ba.Timestamp,
Expand All @@ -8144,6 +8136,14 @@ func TestReplicaRefreshMultiple(t *testing.T) {
}, concurrency.PessimisticEval)
require.NoError(t, pErr.GoError())

st := repl.CurrentLeaseStatus(ctx)
proposal, pErr := repl.requestToProposal(ctx, incCmdID, ba, allSpansGuard(), &st, uncertainty.Interval{})
if pErr != nil {
t.Fatal(pErr)
}
// Save this channel; it may get reset to nil before we read from it.
proposalDoneCh := proposal.doneCh

proposal.ec = endCmds{
repl: repl,
g: g,
Expand Down

0 comments on commit ac23f46

Please sign in to comment.