From 025261c05ef5ea600abdbbe6560f19fa8dd75132 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" <75863576+jeffwashington@users.noreply.github.com> Date: Mon, 27 Sep 2021 11:24:36 -0500 Subject: [PATCH] AcctIdx: when no disk index, always wait for stats (#20248) --- runtime/src/bucket_map_holder.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/runtime/src/bucket_map_holder.rs b/runtime/src/bucket_map_holder.rs index 5853b4d270..408b857177 100644 --- a/runtime/src/bucket_map_holder.rs +++ b/runtime/src/bucket_map_holder.rs @@ -158,7 +158,11 @@ impl BucketMapHolder { let bins = in_mem.len(); let flush = self.disk.is_some(); loop { - if self.all_buckets_flushed_at_current_age() { + if !flush { + self.wait_dirty_or_aged.wait_timeout(Duration::from_millis( + self.stats.remaining_until_next_interval(), + )); + } else if self.all_buckets_flushed_at_current_age() { let wait = std::cmp::min( self.age_timer.remaining_until_next_interval(AGE_MS), self.stats.remaining_until_next_interval(),