]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Quieten UFS cache maintenance skipped warnings
authorAmos Jeffries <squid3@treenet.co.nz>
Sun, 6 Sep 2015 14:01:18 +0000 (07:01 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Sun, 6 Sep 2015 14:01:18 +0000 (07:01 -0700)
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

index 65a6535c588fb03185bcd17ec2dfe2b3e935efb6..e782561bb0fa17b283c30c4c5cafb67f4c0ce8d8 100644 (file)
@@ -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;
     }