Skip to content

Commit

Permalink
Fix flush thread waiting time metric when we disable disk index (#3989)
Browse files Browse the repository at this point in the history
fix flush thread waiting time metric when we disable disk index

Co-authored-by: HaoranYi <[email protected]>
  • Loading branch information
HaoranYi and HaoranYi authored Dec 9, 2024
1 parent a2fb9d1 commit 09ef712
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions accounts-db/src/bucket_map_holder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -319,9 +319,14 @@ impl<T: IndexValue, U: DiskIndexValue + From<T> + Into<T>> BucketMapHolder<T, U>
let mut throttling_wait_ms = None;
loop {
if !flush {
let mut m = Measure::start("wait");
self.wait_dirty_or_aged.wait_timeout(Duration::from_millis(
self.stats.remaining_until_next_interval(),
));
m.stop();
self.stats
.bg_waiting_us
.fetch_add(m.as_us(), Ordering::Relaxed);
} else if self.should_thread_sleep() || throttling_wait_ms.is_some() {
let mut wait = std::cmp::min(
self.age_timer
Expand Down

0 comments on commit 09ef712

Please sign in to comment.