diff --git a/store/multiversion/store.go b/store/multiversion/store.go index 16b0e626b..eae1175d5 100644 --- a/store/multiversion/store.go +++ b/store/multiversion/store.go @@ -236,7 +236,7 @@ func (s *Store) ClearReadset(index int) { } func (s *Store) ClearIterateset(index int) { - s.txReadSets.Delete(index) + s.txIterateSets.Delete(index) } // CollectIteratorItems implements MultiVersionStore. It will return a memDB containing all of the keys present in the multiversion store within the iteration range prior to (exclusive of) the index. diff --git a/tasks/scheduler.go b/tasks/scheduler.go index c0e7c143d..84b55d59d 100644 --- a/tasks/scheduler.go +++ b/tasks/scheduler.go @@ -260,6 +260,9 @@ func (s *scheduler) shouldRerun(task *deliverTxTask) bool { // validated tasks can become unvalidated if an earlier re-run task now conflicts case statusExecuted, statusValidated: + // With the current scheduler, we won't actually get to this step if a previous task has already been determined to be invalid, + // since we choose to fail fast and mark the subsequent tasks as invalid as well. + // TODO: in a future async scheduler that no longer exhaustively validates in order, we may need to carefully handle the `valid=true` with conflicts case if valid, conflicts := s.findConflicts(task); !valid { s.invalidateTask(task)