Skip to content

Commit

Permalink
chore: add warning when region count is smaller than expected
Browse files Browse the repository at this point in the history
Signed-off-by: MrCroxx <mrcroxx@outlook.com>
  • Loading branch information
MrCroxx committed Oct 31, 2024
1 parent 7b44745 commit dda7c42
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions foyer-storage/src/large/generic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,14 @@ where
S: HashBuilder + Debug,
{
async fn open(mut config: GenericLargeStorageConfig<K, V, S>) -> Result<Self> {
if config.flushers + config.clean_region_threshold > config.device.regions() / 2 {
tracing::warn!("[lodc]: large object disk cache stable regions count is too small, flusher [{flushers}] + clean region threshold [{clean_region_threshold}] (default = reclaimers) is supposed to be much larger than the region count [{regions}]",
flushers = config.flushers,
clean_region_threshold = config.clean_region_threshold,
regions = config.device.regions()
);
}

let stats = config.statistics.clone();

let device = config.device.clone();
Expand Down

0 comments on commit dda7c42

Please sign in to comment.