Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

recycle_store_count is moved to try_recycle_store #27797

Merged
merged 1 commit into from
Sep 15, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 7 additions & 16 deletions runtime/src/accounts_db.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5070,6 +5070,9 @@ impl AccountsDb {
ret.get_path(),
old_id
);
self.stats
.recycle_store_count
.fetch_add(1, Ordering::Relaxed);
return Some(ret);
}
}
Expand Down Expand Up @@ -5117,17 +5120,12 @@ impl AccountsDb {
if store.try_available() {
let ret = store.clone();
drop(slot_stores);
if create_extra {
if self
if create_extra
&& self
.try_recycle_and_insert_store(slot, size as u64, std::u64::MAX)
.is_none()
{
self.create_and_insert_store(slot, self.file_size, "store extra");
} else {
self.stats
.recycle_store_count
.fetch_add(1, Ordering::Relaxed);
}
{
self.create_and_insert_store(slot, self.file_size, "store extra");
}
find_existing.stop();
self.stats
Expand All @@ -5148,9 +5146,6 @@ impl AccountsDb {
.fetch_add(find_existing.as_us(), Ordering::Relaxed);

let store = if let Some(store) = self.try_recycle_store(slot, size as u64, std::u64::MAX) {
self.stats
.recycle_store_count
.fetch_add(1, Ordering::Relaxed);
store
} else {
self.create_store(slot, self.file_size, "store", &self.paths)
Expand Down Expand Up @@ -5779,10 +5774,6 @@ impl AccountsDb {
.is_none()
{
self.create_and_insert_store(slot, special_store_size, "large create");
} else {
self.stats
.recycle_store_count
.fetch_add(1, Ordering::Relaxed);
}
}
continue;
Expand Down