Constrain memory ordering on AppendVec::id (#21310)

This commit is contained in:
Brooks Prumo 2021-11-18 20:34:20 -06:00 committed by GitHub
parent 5788973153
commit f7152c889c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 3 deletions

View File

@ -700,7 +700,7 @@ impl AccountStorageEntry {
self.accounts.reset();
*count_and_status = (0, AccountStorageStatus::Available);
self.slot.store(slot, Ordering::Release);
self.id.store(id, Ordering::Relaxed);
self.id.store(id, Ordering::Release);
self.approx_store_count.store(0, Ordering::Relaxed);
self.alive_bytes.store(0, Ordering::Release);
}
@ -738,7 +738,7 @@ impl AccountStorageEntry {
}
pub fn append_vec_id(&self) -> AppendVecId {
self.id.load(Ordering::Relaxed)
self.id.load(Ordering::Acquire)
}
pub fn flush(&self) -> Result<(), IoError> {
@ -5415,7 +5415,7 @@ impl AccountsDb {
if let Some(storages) = storages.get(slot) {
storages.iter().for_each(|store| {
self.dirty_stores
.insert((slot, store.id.load(Ordering::Relaxed)), store.clone());
.insert((slot, store.append_vec_id()), store.clone());
});
}
}