committed by
GitHub
parent
d7051b0d21
commit
9d3afba045
@ -1220,6 +1220,9 @@ struct ShrinkStats {
|
|||||||
bytes_removed: AtomicU64,
|
bytes_removed: AtomicU64,
|
||||||
bytes_written: AtomicU64,
|
bytes_written: AtomicU64,
|
||||||
skipped_shrink: AtomicU64,
|
skipped_shrink: AtomicU64,
|
||||||
|
dead_accounts: AtomicU64,
|
||||||
|
alive_accounts: AtomicU64,
|
||||||
|
cancelled_shrink: AtomicU64,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ShrinkStats {
|
impl ShrinkStats {
|
||||||
@ -1308,6 +1311,21 @@ impl ShrinkStats {
|
|||||||
self.skipped_shrink.swap(0, Ordering::Relaxed) as i64,
|
self.skipped_shrink.swap(0, Ordering::Relaxed) as i64,
|
||||||
i64
|
i64
|
||||||
),
|
),
|
||||||
|
(
|
||||||
|
"alive_accounts",
|
||||||
|
self.alive_accounts.swap(0, Ordering::Relaxed) as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"dead_accounts",
|
||||||
|
self.dead_accounts.swap(0, Ordering::Relaxed) as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
|
(
|
||||||
|
"cancelled_shrink",
|
||||||
|
self.cancelled_shrink.swap(0, Ordering::Relaxed) as i64,
|
||||||
|
i64
|
||||||
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2271,10 +2289,16 @@ impl AccountsDb {
|
|||||||
// not exist in the re-written slot. Unref it to keep the index consistent with
|
// not exist in the re-written slot. Unref it to keep the index consistent with
|
||||||
// rewriting the storage entries.
|
// rewriting the storage entries.
|
||||||
unrefed_pubkeys.push(pubkey);
|
unrefed_pubkeys.push(pubkey);
|
||||||
locked_entry.unref()
|
locked_entry.unref();
|
||||||
|
self.shrink_stats
|
||||||
|
.dead_accounts
|
||||||
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
} else {
|
} else {
|
||||||
alive_accounts.push((pubkey, stored_account));
|
alive_accounts.push((pubkey, stored_account));
|
||||||
alive_total += stored_account.account_size;
|
alive_total += stored_account.account_size;
|
||||||
|
self.shrink_stats
|
||||||
|
.alive_accounts
|
||||||
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -2287,6 +2311,9 @@ impl AccountsDb {
|
|||||||
self.shrink_stats
|
self.shrink_stats
|
||||||
.skipped_shrink
|
.skipped_shrink
|
||||||
.fetch_add(1, Ordering::Relaxed);
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
|
self.shrink_stats
|
||||||
|
.cancelled_shrink
|
||||||
|
.fetch_add(1, Ordering::Relaxed);
|
||||||
for pubkey in unrefed_pubkeys {
|
for pubkey in unrefed_pubkeys {
|
||||||
if let Some(locked_entry) = self.accounts_index.get_account_read_entry(pubkey) {
|
if let Some(locked_entry) = self.accounts_index.get_account_read_entry(pubkey) {
|
||||||
locked_entry.addref();
|
locked_entry.addref();
|
||||||
|
Reference in New Issue
Block a user