Skip to content

Commit

Permalink
add logs
Browse files Browse the repository at this point in the history
  • Loading branch information
udpatil committed Nov 16, 2023
1 parent 5397208 commit 922837b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions store/multiversion/store.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ func (s *Store) validateIterator(index int, tracker iterationTracker, logger log
validChannel := make(chan bool, 1)
abortChannel := make(chan occtypes.Abort, 1)

logger.Info("iterator tracker", "start", tracker.startKey, "end", tracker.endKey, "earlystop", tracker.earlyStopKey, "ascending", tracker.ascending)
logger.Info("iterator tracker", "index", index, "start", tracker.startKey, "end", tracker.endKey, "earlystop", tracker.earlyStopKey, "ascending", tracker.ascending)

// listen for abort while iterating
go func(iterationTracker iterationTracker, items *db.MemDB, returnChan chan bool, abortChan chan occtypes.Abort, logger log.Logger) {
Expand All @@ -286,13 +286,13 @@ func (s *Store) validateIterator(index int, tracker iterationTracker, logger log
for ; mergeIterator.Valid(); mergeIterator.Next() {
if len(expectedKeys) == 0 {
// if we have no more expected keys, then the iterator is invalid
logger.Info("more keys than expected", "key", mergeIterator.Key())
logger.Info("more keys than expected", "index", index, "key", mergeIterator.Key())
returnChan <- false
return
}
key := mergeIterator.Key()
if _, ok := expectedKeys[string(key)]; !ok {
logger.Info("key not found in expected", "key", key)
logger.Info("key not found in expected", "index", index, "key", key)
// if key isn't found
returnChan <- false
return
Expand All @@ -306,7 +306,7 @@ func (s *Store) validateIterator(index int, tracker iterationTracker, logger log
return
}
}
logger.Info("returning with len keys", "len", len(expectedKeys))
logger.Info("returning with len keys", "index", index, "len", len(expectedKeys))
returnChan <- !(len(expectedKeys) > 0)
}(tracker, sortedItems, validChannel, abortChannel, logger)
select {
Expand Down

0 comments on commit 922837b

Please sign in to comment.