]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: ObjectCache::put() clears stale objv 37459/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 8 Sep 2020 19:27:55 +0000 (15:27 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 29 Sep 2020 15:52:06 +0000 (17:52 +0200)
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 <cbodley@redhat.com>
(cherry picked from commit cf531cdd5e655a033f47e04b7dda81435a90271d)

src/rgw/rgw_cache.cc

index 5acc9f9df502abaaf0f6683cdde15d10f70962e8..34601da5f04b23a1c2dd1c6b0810e1d2ab0cc44f 100644 (file)
@@ -170,6 +170,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)