use bg thread pool for shrink (#21950)

This commit is contained in:
Jeff Washington (jwash) 2021-12-16 15:54:38 -06:00 committed by GitHub
parent 3398f5a2f5
commit 347323cbb2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -2654,7 +2654,7 @@ impl AccountsDb {
.accounts_loaded
.fetch_add(len as u64, Ordering::Relaxed);
self.thread_pool.install(|| {
self.thread_pool_clean.install(|| {
let chunk_size = 50; // # accounts/thread
let chunks = len / chunk_size + 1;
(0..chunks).into_par_iter().for_each(|chunk| {
@ -2995,7 +2995,7 @@ impl AccountsDb {
let mut measure_shrink_all_candidates = Measure::start("shrink_all_candidate_slots-ms");
let num_candidates = shrink_slots.len();
let shrink_candidates_count: usize = self.thread_pool.install(|| {
let shrink_candidates_count: usize = self.thread_pool_clean.install(|| {
shrink_slots
.into_par_iter()
.map(|(slot, slot_shrink_candidates)| {