]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Do not allow max-swap-rate and swap-timeout reconfiguration for Rock Store.
authorDmitry Kurochkin <dmitry.kurochkin@measurement-factory.com>
Thu, 27 Oct 2011 22:44:20 +0000 (16:44 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Thu, 27 Oct 2011 22:44:20 +0000 (16:44 -0600)
These options are used to configure DiskIO module during Rock SwapDir
initialization.  During reconfiguration, the values are updated in Rock
SwapDir, but they do not reach the DiskIO module.  Thus, while Squid says that
option has a new value, the new value is never really used.  This patch fixes
this inconsistency.

In the future, we may support reconfiguration for max-swap-rate and
swap-timeout, but that would require adding reconfiguration support
to DiskIO modules.

src/fs/rock/RockSwapDir.cc

index 910239f109fb2635115b3ffd8dfb7a7257db7d87..77b62b6dcfd60334228b500ea95c1b56b408b437 100644 (file)
@@ -335,10 +335,13 @@ Rock::SwapDir::parseTimeOption(char const *option, const char *value, int reconf
 
     const time_msec_t newTime = static_cast<time_msec_t>(parsedValue);
 
-    if (reconfiguring && *storedTime != newTime)
-        debugs(3, DBG_IMPORTANT, "cache_dir " << path << ' ' << option << " is now " << newTime);
-
-    *storedTime = newTime;
+    if (!reconfiguring)
+        *storedTime = newTime;
+    else if (*storedTime != newTime) {
+        debugs(3, DBG_IMPORTANT, "WARNING: cache_dir " << path << ' ' << option
+               << " cannot be changed dynamically, value left unchanged: " <<
+               *storedTime);
+    }
 
     return true;
 }
@@ -379,10 +382,13 @@ Rock::SwapDir::parseRateOption(char const *option, const char *value, int isaRec
         self_destruct();
     }
 
-    if (isaReconfig && *storedRate != newRate)
-        debugs(3, DBG_IMPORTANT, "cache_dir " << path << ' ' << option << " is now " << newRate);
-
-    *storedRate = newRate;
+    if (!isaReconfig)
+        *storedRate = newRate;
+    else if (*storedRate != newRate) {
+        debugs(3, DBG_IMPORTANT, "WARNING: cache_dir " << path << ' ' << option
+               << " cannot be changed dynamically, value left unchanged: " <<
+               *storedRate);
+    }
 
     return true;
 }