AcctIdx: grow data buckets to default size on creation (#20454)

This commit is contained in:
Jeff Washington (jwash) 2021-10-05 19:16:02 -05:00 committed by GitHub
parent d03bf2bbfe
commit 6ea96b3274
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View File

@ -1,7 +1,7 @@
use crate::bucket_item::BucketItem;
use crate::bucket_map::BucketMapError;
use crate::bucket_stats::BucketMapStats;
use crate::bucket_storage::{BucketStorage, Uid, UID_UNLOCKED};
use crate::bucket_storage::{BucketStorage, Uid, DEFAULT_CAPACITY_POW2, UID_UNLOCKED};
use crate::index_entry::IndexEntry;
use crate::{MaxSearch, RefCount};
use rand::thread_rng;
@ -413,7 +413,7 @@ impl<T: Clone + Copy> Bucket<T> {
&self.drives,
self.index.max_search,
self.data.get(data_index as usize),
current_capacity_pow2 + 1,
std::cmp::max(current_capacity_pow2 + 1, DEFAULT_CAPACITY_POW2),
1 << data_index,
Self::elem_size(),
&self.stats.data,

View File

@ -29,7 +29,7 @@ use std::sync::Arc;
23 8,388,608
24 16,777,216
*/
const DEFAULT_CAPACITY_POW2: u8 = 5;
pub const DEFAULT_CAPACITY_POW2: u8 = 5;
/// A Header UID of 0 indicates that the header is unlocked
pub(crate) const UID_UNLOCKED: Uid = 0;