AcctIdx: when no disk index, always wait for stats (#20248)

This commit is contained in:
Jeff Washington (jwash) 2021-09-27 11:24:36 -05:00 committed by GitHub
parent 833f7761d2
commit 025261c05e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 1 deletions

View File

@ -158,7 +158,11 @@ impl<T: IndexValue> BucketMapHolder<T> {
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(),