I'm not a Squid expert, but have been asked to help a client who's running it.

He has a Squid cache that's about 80GB in size and has been up for something like two years. The server has had occasional emergency reboots, and so he wants to check the cache for consistency and repair any inconsistencies or flaws in the database

I tried starting Squid with the parameters -SF, since this supposedly does sanity checks on every entry in the cache. Sure enough, the software began to detect inconsistencies such as the following:

003/07/23 01:41:50| storeDiskdCleanupDoubleCheck: SIZE MISMATCH
2003/07/23 01:41:50| storeDiskdCleanupDoubleCheck: FILENO 0044B156
2003/07/23 01:41:50| storeDiskdCleanupDoubleCheck: PATH /var/cache/04/B1/0044B156
2003/07/23 01:41:50| storeDiskdCleanupDoubleCheck: ENTRY SIZE: 908, FILE SIZE: 1673
2003/07/23 01:41:50| StoreEntry->key: 2730205BD26DD1DBB6D6589BDE27156B
2003/07/23 01:41:50| StoreEntry->next: 0x236d5680
2003/07/23 01:41:50| StoreEntry->mem_obj: 0x0
2003/07/23 01:41:50| StoreEntry->timestamp: 1056689294
2003/07/23 01:41:50| StoreEntry->lastref: 1056689341
2003/07/23 01:41:50| StoreEntry->expires: -1
2003/07/23 01:41:50| StoreEntry->lastmod: 1043956191
2003/07/23 01:41:50| StoreEntry->swap_file_sz: 908
2003/07/23 01:41:50| StoreEntry->refcount: 11
2003/07/23 01:41:50| StoreEntry->flags: CACHABLE,DISPATCHED
2003/07/23 01:41:50| StoreEntry->swap_dirn: 0
2003/07/23 01:41:50| StoreEntry->swap_filen: 4501846
2003/07/23 01:41:50| StoreEntry->lock_count: 0
2003/07/23 01:41:50| StoreEntry->mem_status: 0
2003/07/23 01:41:50| StoreEntry->ping_status: 0
2003/07/23 01:41:50| StoreEntry->store_status: 0
2003/07/23 01:41:50| StoreEntry->swap_status: 2


But while it noticed the problems, it didn't delete the entries! A subsequent run revealed all of the same problems.

How can Squid be induced to remove bad entries during the scan of its database? Preferably without jettisoning the rest of the data?

--Brett Glass

Reply via email to