AcctIdx: avoid overcounting inserts (#20544)

This commit is contained in:
Jeff Washington (jwash) 2021-10-08 13:57:47 -05:00 committed by GitHub
parent 00c6536528
commit 2c3d52b4cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -26,7 +26,7 @@ pub struct BucketMapHolderStats {
pub keys: AtomicU64,
pub deletes: AtomicU64,
pub inserts: AtomicU64,
pub count: AtomicU64,
count: AtomicU64,
pub bg_waiting_us: AtomicU64,
pub bg_throttling_wait_us: AtomicU64,
pub count_in_mem: AtomicU64,

View File

@ -348,12 +348,12 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
disk_entry
} else {
// not on disk, so insert new thing
self.stats().insert_or_delete(true, self.bin);
new_value.into()
};
assert!(new_value.dirty());
vacant.insert(new_value);
self.stats().insert_or_delete_mem(true, self.bin);
self.stats().insert_or_delete(true, self.bin);
}
}
};