From: Alex Rousskov Date: Tue, 6 Sep 2011 20:42:29 +0000 (-0600) Subject: Polished cache_dir rebuild warnings. X-Git-Tag: take08~28 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=28edca6145fbf9528b68484be69f8c6671d755a2;p=thirdparty%2Fsquid.git Polished cache_dir rebuild warnings. 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. --- diff --git a/src/store_rebuild.cc b/src/store_rebuild.cc index a8d0d2f992..40b188d3eb 100644 --- a/src/store_rebuild.cc +++ b/src/store_rebuild.cc @@ -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; }