From 017170c99d564dbeabb62089e3fc684cdcbe46a5 Mon Sep 17 00:00:00 2001 From: "Jeff Washington (jwash)" Date: Thu, 24 Feb 2022 10:17:35 -0600 Subject: [PATCH] DiskIdx: new items are not dirty by default (#23123) --- runtime/src/accounts_index.rs | 6 ++++++ runtime/src/in_mem_accounts_index.rs | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/runtime/src/accounts_index.rs b/runtime/src/accounts_index.rs index 8ecdfdde29..c98434082a 100644 --- a/runtime/src/accounts_index.rs +++ b/runtime/src/accounts_index.rs @@ -203,6 +203,12 @@ impl AccountMapEntryMeta { age: AtomicU8::new(storage.future_age_to_flush()), } } + pub fn new_clean(storage: &Arc>) -> Self { + AccountMapEntryMeta { + dirty: AtomicBool::new(false), + age: AtomicU8::new(storage.future_age_to_flush()), + } + } } #[derive(Debug, Default)] diff --git a/runtime/src/in_mem_accounts_index.rs b/runtime/src/in_mem_accounts_index.rs index dd72f0187c..7be77c9309 100644 --- a/runtime/src/in_mem_accounts_index.rs +++ b/runtime/src/in_mem_accounts_index.rs @@ -506,7 +506,7 @@ impl InMemAccountsIndex { Arc::new(AccountMapEntryInner::new( slot_list, ref_count, - AccountMapEntryMeta::new_dirty(&self.storage), + AccountMapEntryMeta::new_clean(&self.storage), )) }