Fix a timer bug in MergingIterator::Seek() caused by #5871 (#5874)

Summary:
Conflict resolving in 846e05005d ("Revert "Merging iterator to avoid child iterator reseek for some cases") caused some timer misplaced. Fix it.
Pull Request resolved: https://github.com/facebook/rocksdb/pull/5874

Test Plan: See it build.

Differential Revision: D17705073

fbshipit-source-id: 9bd3a8dc4901ac33c2c6fc5b1091ffbc56a8529f
main
sdong 5 years ago committed by Facebook Github Bot
parent 9f31df8679
commit d783af1857
  1. 17
      table/merging_iterator.cc

@ -112,15 +112,18 @@ class MergingIterator : public InternalIterator {
ClearHeaps(); ClearHeaps();
status_ = Status::OK(); status_ = Status::OK();
for (auto& child : children_) { for (auto& child : children_) {
PERF_TIMER_GUARD(seek_child_seek_time); {
PERF_TIMER_GUARD(seek_child_seek_time);
child.Seek(target); child.Seek(target);
}
PERF_COUNTER_ADD(seek_child_seek_count, 1); PERF_COUNTER_ADD(seek_child_seek_count, 1);
// Strictly, we timed slightly more than min heap operation, {
// but these operations are very cheap. // Strictly, we timed slightly more than min heap operation,
PERF_TIMER_GUARD(seek_min_heap_time); // but these operations are very cheap.
AddToMinHeapOrCheckStatus(&child); PERF_TIMER_GUARD(seek_min_heap_time);
AddToMinHeapOrCheckStatus(&child);
}
} }
direction_ = kForward; direction_ = kForward;
{ {

Loading…
Cancel
Save