{
RWLock::WLocker l(lock);
- ldout(cct, 10) << "cache put: name=" << cache_info.cache_locator << dendl;
+ ldout(cct, 10) << "chain_cache_entry: cache_locator=" << cache_info.cache_locator << dendl;
map<string, ObjectCacheEntry>::iterator iter = cache_map.find(cache_info.cache_locator);
if (iter == cache_map.end()) {
+ ldout(cct, 20) << "chain_cache_entry: couldn't find cachce locator" << dendl;
return false;
}
ObjectCacheEntry& entry = iter->second;
if (entry.gen != cache_info.gen) {
+ ldout(cct, 20) << "chain_cache_entry: entry.gen (" << entry.gen << ") != cache_info.gen (" << cache_info.gen << ")" << dendl;
return false;
}
RGWBucketEntryPoint& entry_point,
RGWObjVersionTracker *objv_tracker,
time_t *pmtime,
- map<string, bufferlist> *pattrs)
+ map<string, bufferlist> *pattrs,
+ rgw_cache_entry_info *cache_info)
{
bufferlist bl;
- int ret = rgw_get_system_obj(this, ctx, zone.domain_root, bucket_name, bl, objv_tracker, pmtime, pattrs);
+ int ret = rgw_get_system_obj(this, ctx, zone.domain_root, bucket_name, bl, objv_tracker, pmtime, pattrs, cache_info);
if (ret < 0) {
return ret;
}
RGWBucketEntryPoint entry_point;
time_t ep_mtime;
RGWObjVersionTracker ot;
- int ret = get_bucket_entrypoint_info(ctx, bucket_name, entry_point, &ot, &ep_mtime, pattrs);
+ rgw_cache_entry_info entry_cache_info;
+ int ret = get_bucket_entrypoint_info(ctx, bucket_name, entry_point, &ot, &ep_mtime, pattrs, &entry_cache_info);
if (ret < 0) {
info.bucket.name = bucket_name; /* only init this field */
return ret;
if (pattrs)
*pattrs = e.attrs;
- binfo_cache.put(this, bucket_name, &e, cache_info);
+ /* chain to both bucket entry point and bucket instance */
+ if (binfo_cache.put(this, bucket_name, &e, entry_cache_info)) {
+ binfo_cache.put(this, bucket_name, &e, cache_info);
+ }
return 0;
}
map<string, bufferlist> *pattrs);
int put_bucket_instance_info(RGWBucketInfo& info, bool exclusive, time_t mtime, map<string, bufferlist> *pattrs);
int get_bucket_entrypoint_info(void *ctx, const string& bucket_name, RGWBucketEntryPoint& entry_point, RGWObjVersionTracker *objv_tracker, time_t *pmtime,
- map<string, bufferlist> *pattrs);
+ map<string, bufferlist> *pattrs, rgw_cache_entry_info *cache_info = NULL);
int get_bucket_instance_info(void *ctx, const string& meta_key, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
int get_bucket_instance_info(void *ctx, rgw_bucket& bucket, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs);
int get_bucket_instance_from_oid(void *ctx, string& oid, RGWBucketInfo& info, time_t *pmtime, map<string, bufferlist> *pattrs,