diff --git a/store/multiversion/store.go b/store/multiversion/store.go index 643647fc6..9f242ddac 100644 --- a/store/multiversion/store.go +++ b/store/multiversion/store.go @@ -239,7 +239,7 @@ func (s *Store) GetIterateset(index int) Iterateset { } // 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. -func (s *Store) CollectIteratorItems(index int) *db.MemDB { +func (s *Store) CollectIteratorItems(index int, logger log.Logger) *db.MemDB { sortedItems := db.NewMemDB() // get all writeset keys prior to index @@ -250,6 +250,7 @@ func (s *Store) CollectIteratorItems(index int) *db.MemDB { } indexedWriteset := writesetAny.([]string) // TODO: do we want to exclude keys out of the range or just let the iterator handle it? + logger.Info("Logging sorted keys from writeset index", "index", i, "length", len(indexedWriteset), "keys", indexedWriteset) for _, key := range indexedWriteset { // TODO: inefficient because (logn) for each key + rebalancing? maybe theres a better way to add to a tree to reduce rebalancing overhead sortedItems.Set([]byte(key), []byte{}) @@ -260,7 +261,7 @@ func (s *Store) CollectIteratorItems(index int) *db.MemDB { func (s *Store) validateIterator(index int, tracker iterationTracker, logger log.Logger) bool { // collect items from multiversion store - sortedItems := s.CollectIteratorItems(index) + sortedItems := s.CollectIteratorItems(index, logger) // add the iterationtracker writeset keys to the sorted items for key := range tracker.writeset { sortedItems.Set([]byte(key), []byte{})