Skip to content

Commit

Permalink
fix deleteIterateSet and leave some comments (#395)
Browse files Browse the repository at this point in the history
## Describe your changes and provide context

## Testing performed to validate your change
  • Loading branch information
udpatil committed Jan 25, 2024
1 parent 8e8e4fb commit f43e168
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion store/multiversion/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 3 additions & 0 deletions tasks/scheduler.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Expand Down

0 comments on commit f43e168

Please sign in to comment.