]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: object expirer: handle resharded buckets
authorAbhishek Lekshmanan <abhishek@suse.com>
Fri, 26 Apr 2019 14:20:15 +0000 (16:20 +0200)
committerAbhishek Lekshmanan <abhishek@suse.com>
Mon, 6 May 2019 09:51:57 +0000 (11:51 +0200)
Previously we fetched the bucket instance info which changes during a reshard
causing the bucket info to fail, since the subsequent checks will assume that
would mean a deleted bucket, the expiry hint is purged as well, leaving a non
deleted object as well as a deleted hint. This should fix newer runs of object
expiry processes. Finding out stale expired objects will require more complex
rgw-admin tooling support

Fixes: https://tracker.ceph.com/issues/39495
Signed-off-by: Abhishek Lekshmanan <abhishek@suse.com>
src/rgw/rgw_object_expirer_core.cc

index bce6ce4882f69f52d4be7da520e1cc0a7e9ee1eb..b2e302baab67926b50dd5715f9258100e6873fd3 100644 (file)
@@ -52,11 +52,14 @@ int RGWObjectExpirer::init_bucket_info(const string& tenant_name,
    * punching the tenant through the objexp_hint_entry, but now we
    * find that our instances do not actually have tenants. They are
    * unique thanks to IDs. So the tenant string is not needed...
+
+   * XXX reloaded: it turns out tenants were needed after all since bucket ids
+   * are ephemeral, good call encoding tenant info!
    */
-  const string bucket_instance_id = bucket_name + ":" + bucket_id;
-  int ret = store->get_bucket_instance_info(obj_ctx, bucket_instance_id,
-          bucket_info, NULL, NULL);
-  return ret;
+
+  return store->get_bucket_info(obj_ctx, tenant_name, bucket_name,
+                               bucket_info, nullptr, nullptr);
+
 }
 
 int RGWObjectExpirer::garbage_single_object(objexp_hint_entry& hint)