DiskIdx: new items are not dirty by default (#23123)

This commit is contained in:
Jeff Washington (jwash) 2022-02-24 10:17:35 -06:00 committed by GitHub
parent a14c7c37ee
commit 017170c99d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 1 deletions

View File

@ -203,6 +203,12 @@ impl AccountMapEntryMeta {
age: AtomicU8::new(storage.future_age_to_flush()),
}
}
pub fn new_clean<T: IndexValue>(storage: &Arc<BucketMapHolder<T>>) -> Self {
AccountMapEntryMeta {
dirty: AtomicBool::new(false),
age: AtomicU8::new(storage.future_age_to_flush()),
}
}
}
#[derive(Debug, Default)]

View File

@ -506,7 +506,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
Arc::new(AccountMapEntryInner::new(
slot_list,
ref_count,
AccountMapEntryMeta::new_dirty(&self.storage),
AccountMapEntryMeta::new_clean(&self.storage),
))
}