AcctIdx: fix some missing dirty calls (#20089)

This commit is contained in:
Jeff Washington (jwash) 2021-09-22 08:45:08 -05:00 committed by GitHub
parent e68eee830b
commit 6c518102dd
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 1 deletions

View File

@ -297,6 +297,7 @@ impl<T: IndexValue> WriteAccountMapEntry<T> {
// If it's the first non-cache insert, also bump the stored ref count
self.borrow_owned_entry().add_un_ref(true);
}
self.borrow_owned_entry().set_dirty(true);
}
}

View File

@ -209,6 +209,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
Self::update_stat(&self.stats().updates_in_mem, 1);
}
Entry::Vacant(vacant) => {
assert!(new_value.dirty());
vacant.insert(new_value);
self.stats().insert_or_delete(true, self.bin);
}
@ -233,7 +234,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
if addref {
current.add_un_ref(true);
}
new_value.set_dirty(true);
current.set_dirty(true);
}
// modifies slot_list
@ -344,6 +345,7 @@ impl<T: IndexValue> InMemAccountsIndex<T> {
))
}
Entry::Vacant(account_entry) => {
assert!(new_entry.dirty());
account_entry.insert(new_entry);
None
}