From: Casey Bodley Date: Tue, 8 Sep 2020 19:27:55 +0000 (-0400) Subject: rgw: ObjectCache::put() clears stale objv X-Git-Tag: v15.2.9~122^2~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F37337%2Fhead;p=ceph.git rgw: ObjectCache::put() clears stale objv if an existing object is cached with an object version, but it's mutated without updating that version number, clear the OBJV flag so that later cache reads asking for an object version result in a miss and re-read the version from the osd Fixes: https://tracker.ceph.com/issues/47306 Signed-off-by: Casey Bodley (cherry picked from commit cf531cdd5e655a033f47e04b7dda81435a90271d) --- diff --git a/src/rgw/rgw_cache.cc b/src/rgw/rgw_cache.cc index 90a608d1bf15..6908e7f9d252 100644 --- a/src/rgw/rgw_cache.cc +++ b/src/rgw/rgw_cache.cc @@ -176,6 +176,9 @@ void ObjectCache::put(const string& name, ObjectCacheInfo& info, rgw_cache_entry cache_info->gen = entry.gen; } + // put() must include the latest version if we're going to keep caching it + target.flags &= ~CACHE_FLAG_OBJV; + target.flags |= info.flags; if (info.flags & CACHE_FLAG_META)