I found this bug using zen theme which by default call on each page load drupal_rebuild_theme_registry which make this call: cache_clear_all('theme_registry', 'cache', TRUE);
So wildcard argument is set to true so cache_clear_all from cacherouter.inc on line 152 make this call:
$cache->delete($cid . '*', $table); with $cid = 'theme_registry' and $table = 'cache'.
Personally, i'm using apc engine as a cache backend and here is the code of apc delete function (when wildcard set to true):

if (substr($key, -1, 1) == '*') {
      $key = substr($key, 0, strlen($key) - 1);
      $lookup = apc_fetch($this->lookup);
      foreach ($lookup as $k => $v) {
        if (substr($k, 0, strlen($key) - 1)) {
          apc_delete($k);
          unset($lookup[$k]);  
        }
      }
      if ($this->lock()) {
        apc_store($this->lookup, $lookup);
        $this->unlock();
      }
    }

if (substr($k, 0, strlen($key) - 1)) will always be true 'cause substr returns at least an empty string, so i think it should compare substr result with $key like this:

if (substr($k, 0, strlen($key) - 1) == $key)

After this modification, it seems to work.
hope this helps.

Comments

vinzentt’s picture

Priority: Normal » Critical
vinzentt’s picture

Title: apc delete function deleting all entries when called with wildcard = true (ie $key = 'blabla*') » apc delete function flushing cache with wildcard = true
vinzentt’s picture

Assigned: Unassigned » vinzentt
vinzentt’s picture

Status: Active » Needs review
StatusFileSize
new466 bytes

here is the patch corresponding to the bug fix i mentionned.

vinzentt’s picture

StatusFileSize
new520 bytes

same patch but with the exacts paths

slantview’s picture

Status: Needs review » Fixed

This is fixed in my latest commits. Thanks.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for two weeks with no activity.