]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Quieten UFS cache maintenance skipped warnings
authorAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Sep 2015 19:54:07 +0000 (12:54 -0700)
committerAmos Jeffries <squid3@treenet.co.nz>
Fri, 4 Sep 2015 19:54:07 +0000 (12:54 -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 b2123f68ba00298c064c511c0b6f4c82bc19fde1..371e7fdfd2041d7e7a81c2af87a38850db70ae32 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;
     }