From 2e4844b99759511b6dc3141c1eb8b263c31e457b Mon Sep 17 00:00:00 2001 From: Croxx Date: Thu, 31 Oct 2024 14:25:28 +0800 Subject: [PATCH] chore: add warning when region count is smaller than expected (#784) Signed-off-by: MrCroxx --- foyer-storage/src/large/generic.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/foyer-storage/src/large/generic.rs b/foyer-storage/src/large/generic.rs index 047d96a7..35b4205a 100644 --- a/foyer-storage/src/large/generic.rs +++ b/foyer-storage/src/large/generic.rs @@ -183,6 +183,14 @@ where S: HashBuilder + Debug, { async fn open(mut config: GenericLargeStorageConfig) -> Result { + 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();