From 28067baed382cc2e6e58df51a7cc3d9fc6c5049a Mon Sep 17 00:00:00 2001 From: Amos Jeffries Date: Sun, 6 Sep 2015 07:01:18 -0700 Subject: [PATCH] Quieten UFS cache maintenance skipped warnings The maintenance loop cycles once per second. On long DIRTY cache rebuilds this can reult in a lot of log mesages at level 1. * reduce the messages to L=3 except once per minute allow one at L=1 * perform the under-size limit check first to allow completely silent skipping when no maintenance would have taken place anyway. --- src/fs/ufs/UFSSwapDir.cc | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/fs/ufs/UFSSwapDir.cc b/src/fs/ufs/UFSSwapDir.cc index 65a6535c58..e782561bb0 100644 --- a/src/fs/ufs/UFSSwapDir.cc +++ b/src/fs/ufs/UFSSwapDir.cc @@ -440,18 +440,25 @@ Fs::Ufs::UFSSwapDir::maintain() * of low-, high- water and the total capacity limit. */ - /* We can't delete objects while rebuilding swap */ - /* XXX FIXME each store should start maintaining as it comes online. */ - if (StoreController::store_dirs_rebuilding) { - debugs(47, DBG_IMPORTANT, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path); - return; - } - // minSize() is swap_low_watermark in bytes const uint64_t lowWaterSz = minSize(); if (currentSize() < lowWaterSz) { - debugs(47, 2, "space still available in " << path); + debugs(47, 5, "space still available in " << path); + return; + } + + /* We can't delete objects while rebuilding swap */ + /* XXX each store should start maintaining as it comes online. */ + if (StoreController::store_dirs_rebuilding) { + // suppress the warnings, except once each minute + static int64_t lastWarn = 0; + int warnLevel = 3; + if (lastWarn+60 < squid_curtime) { + lastWarn = squid_curtime; + warnLevel = DBG_IMPORTANT; + } + debugs(47, warnLevel, StoreController::store_dirs_rebuilding << " cache_dir still rebuilding. Skip GC for " << path); return; } -- 2.47.2