This is a followup for https://www.drupal.org/project/memcache/issues/2993368 while MemCacheDrupal::get() works now, MemCacheDrupal::getMultiple() still makes old invalid data valid again.

CommentFileSizeAuthor
#2 3055155-multiget-stampede.patch529 bytesmarco
Support from Acquia helps fund testing for Drupal Acquia logo

Comments

marco created an issue. See original summary.

marco’s picture

The reason is that valid(), in case of stampede, changes $cache, but the $results array in getMultiple() is not updated.
Note that cache_get_multiple() is called way more than cache_get().

In our case, this resulted in cache_get_multiple() returning NULL as the cached item, and this was very visible during load testing. I believe what happened was:
- dmemcache_get_multi() returned NULL simply because the item did not exist
- valid() kicks stampede protection and gets the correct value, but does not end up updating the value in getMultiple()
- valid() has a valid value, so it returns true
- getMultiple() returns the original value, NULL

marco’s picture

Issue summary: View changes
Fabianx’s picture

Status: Active » Reviewed & tested by the community

RTBC - Great catch!

  • Jeremy committed 4aed34e on 7.x-1.x authored by marco
    Issue #3055155 by marco: MemCacheDrupal::getMultiple() issue with...
Jeremy’s picture

Priority: Critical » Major
Status: Reviewed & tested by the community » Fixed

Thanks for the patch Marco, and for testing Fabian! Patch committed, and will be part of the next release.

Status: Fixed » Closed (fixed)

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

ndobromirov’s picture

Is this affecting D8?