Skip to content

Commit

Permalink
Removes atomic-ness from AccountStorageEntry id and slot fields
Browse files Browse the repository at this point in the history
  • Loading branch information
brooksprumo committed Mar 6, 2024
1 parent e7fbb6c commit 98a70e7
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions accounts-db/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1005,9 +1005,9 @@ struct CleanKeyTimings {
/// Persistent storage structure holding the accounts
#[derive(Debug)]
pub struct AccountStorageEntry {
pub(crate) id: AtomicAppendVecId,
pub(crate) id: AppendVecId,

pub(crate) slot: AtomicU64,
pub(crate) slot: Slot,

/// storage holding the accounts
pub accounts: AccountsFile,
Expand Down Expand Up @@ -1037,8 +1037,8 @@ impl AccountStorageEntry {
let accounts = AccountsFile::AppendVec(AppendVec::new(&path, true, file_size as usize));

Self {
id: AtomicAppendVecId::new(id),
slot: AtomicU64::new(slot),
id,
slot,
accounts,
count_and_status: SeqLock::new((0, AccountStorageStatus::Available)),
approx_store_count: AtomicUsize::new(0),
Expand All @@ -1053,8 +1053,8 @@ impl AccountStorageEntry {
num_accounts: usize,
) -> Self {
Self {
id: AtomicAppendVecId::new(id),
slot: AtomicU64::new(slot),
id,
slot,
accounts,
count_and_status: SeqLock::new((0, AccountStorageStatus::Available)),
approx_store_count: AtomicUsize::new(num_accounts),
Expand Down Expand Up @@ -1112,11 +1112,11 @@ impl AccountStorageEntry {
}

pub fn slot(&self) -> Slot {
self.slot.load(Ordering::Acquire)
self.slot
}

pub fn append_vec_id(&self) -> AppendVecId {
self.id.load(Ordering::Acquire)
self.id
}

pub fn flush(&self) -> Result<(), AccountsFileError> {
Expand Down

0 comments on commit 98a70e7

Please sign in to comment.