recycle_store_count is moved to try_recycle_store (#27797)

This commit is contained in:
kirill lykov 2022-09-15 21:27:09 +02:00 committed by GitHub
parent aae07807cb
commit 1a4b8b5b79
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 16 deletions

View File

@ -5088,6 +5088,9 @@ impl AccountsDb {
ret.get_path(),
old_id
);
self.stats
.recycle_store_count
.fetch_add(1, Ordering::Relaxed);
return Some(ret);
}
}
@ -5135,17 +5138,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
@ -5166,9 +5164,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)
@ -5797,10 +5792,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;