From: Casey Bodley Date: Wed, 30 May 2018 13:20:01 +0000 (-0400) Subject: rgw: update ObjectCacheInfo::time_added on overwrite X-Git-Tag: v14.0.1~1214^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F22324%2Fhead;p=ceph.git rgw: update ObjectCacheInfo::time_added on overwrite Fixes: http://tracker.ceph.com/issues/24346 Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_cache.cc b/src/rgw/rgw_cache.cc index 797e22bc3dc..7dc2156b0a5 100644 --- a/src/rgw/rgw_cache.cc +++ b/src/rgw/rgw_cache.cc @@ -127,6 +127,7 @@ void ObjectCache::put(const string& name, ObjectCacheInfo& info, rgw_cache_entry auto [iter, inserted] = cache_map.emplace(name, ObjectCacheEntry{}); ObjectCacheEntry& entry = iter->second; + entry.info.time_added = ceph::coarse_mono_clock::now(); if (inserted) { entry.lru_iter = lru.end(); } diff --git a/src/rgw/rgw_cache.h b/src/rgw/rgw_cache.h index 1911db9bcf4..6dfc0318d50 100644 --- a/src/rgw/rgw_cache.h +++ b/src/rgw/rgw_cache.h @@ -58,7 +58,7 @@ struct ObjectCacheInfo { map rm_xattrs; ObjectMetaInfo meta; obj_version version = {}; - ceph::coarse_mono_time time_added = ceph::coarse_mono_clock::now(); + ceph::coarse_mono_time time_added; ObjectCacheInfo() = default;