From f43e1681886526da3537d7accc21a04282676361 Mon Sep 17 00:00:00 2001 From: Uday Patil Date: Fri, 12 Jan 2024 13:21:48 -0600 Subject: [PATCH] fix deleteIterateSet and leave some comments (#395) ## Describe your changes and provide context ## Testing performed to validate your change --- store/multiversion/store.go | 2 +- tasks/scheduler.go | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) 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)