20c4201 Bug 718303 - Intensive updates on masters could break the consumer's cache

Authored and Committed by nhosoi 12 years ago
    Bug 718303 - Intensive updates on masters could break the consumer's cache
    
    https://bugzilla.redhat.com/show_bug.cgi?id=718303
    
    Description: When adding a tombstone to the entry cache, the source
    code assumed the original entry already existed in the cache and
    cache_add failed.  But under some high stress + narrow window to
    receive the updates from multi-masters, the original entry could
    have been already evicted and the tombstone could be successfully
    added to the entry cache.  When the rare case occurred, the entry
    in the cache was freed instead of put into LRU and when the entry
    was searched in the entry cache, the server died by segfault.
    
    This patch checks the entry after attempting to put it into the
    entry cache.  If the entry's state is in-cache, sets the correct
    flag (tombstone_in_cache = 1).