]> git.ipfire.org Git - thirdparty/squid.git/commitdiff
Polished cache_dir rebuild warnings.
authorAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 20:42:29 +0000 (14:42 -0600)
committerAlex Rousskov <rousskov@measurement-factory.com>
Tue, 6 Sep 2011 20:42:29 +0000 (14:42 -0600)
Use DBG_IMPORTANT level, WARNING: prefix, and explain that the bad entry is
going to be ignored. While this is an improvement of the moved code, most
of these warnings are still not user-friendly as they report low-level
details that most admins cannot use.

src/store_rebuild.cc

index a8d0d2f9924ad479a31d052c5edb127f2fbd59fa..40b188d3eb2f1bad1b6bac7569fd0e6299ecd55c 100644 (file)
@@ -294,8 +294,8 @@ storeRebuildLoadEntry(int fd, int diskIndex, MemBuf &buf,
     statCounter.syscalls.disk.reads++;
     if (len < 0) {
         const int xerrno = errno;
-        debugs(47, 1, "cache_dir[" << diskIndex << "]: " <<
-            "failed to read swap entry meta data: " << xstrerr(xerrno));
+        debugs(47, DBG_IMPORTANT, "WARNING: cache_dir[" << diskIndex << "]: " <<
+            "Ignoring cached entry after meta data read failure: " << xstrerr(xerrno));
         return false;
     }
 
@@ -316,13 +316,14 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
     }
 
     if (!aBuilder.isBufferSane()) {
-        debugs(47,1, "Warning: Ignoring malformed cache entry.");
+        debugs(47, DBG_IMPORTANT, "WARNING: Ignoring malformed cache entry.");
         return false;
     }
 
     StoreMeta *tlv_list = aBuilder.createStoreMeta();
     if (!tlv_list) {
-        debugs(47, 1, HERE << "failed to get swap entry meta data list");
+        debugs(47, DBG_IMPORTANT, "WARNING: Ignoring cache entry with invalid " <<
+               "meta data");
         return false;
     }
 
@@ -337,7 +338,7 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
     tlv_list = NULL;
 
     if (storeKeyNull(key)) {
-        debugs(47,1, HERE << "NULL swap entry key");
+        debugs(47, DBG_IMPORTANT, "WARNING: Ignoring keyless cache entry");
         return false;
     }
 
@@ -350,13 +351,14 @@ storeRebuildParseEntry(MemBuf &buf, StoreEntry &tmpe, cache_key *key,
         } else if (tmpe.swap_file_sz == (uint64_t)(expectedSize - swap_hdr_len)) {
             tmpe.swap_file_sz = expectedSize;
         } else if (tmpe.swap_file_sz != expectedSize) {
-            debugs(47, 1, HERE << "swap entry SIZE MISMATCH " <<
-                   tmpe.swap_file_sz << "!=" << expectedSize);
+            debugs(47, DBG_IMPORTANT, "WARNING: Ignoring cache entry due to a " <<
+                   "SIZE MISMATCH " << tmpe.swap_file_sz << "!=" << expectedSize);
             return false;
         }
     } else
     if (tmpe.swap_file_sz <= 0) {
-        debugs(47, 1, HERE << "missing swap entry size: " << tmpe);
+        debugs(47, DBG_IMPORTANT, "WARNING: Ignoring cache entry with " <<
+               "unknown size: " << tmpe);
         return false;
     }