From 7f958c64dff006885da7e0fafa51e56ecbc6f973 Mon Sep 17 00:00:00 2001 From: Abhishek Lekshmanan Date: Fri, 26 Apr 2019 16:20:15 +0200 Subject: [PATCH] rgw: object expirer: handle resharded buckets 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 --- src/rgw/rgw_object_expirer_core.cc | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/rgw/rgw_object_expirer_core.cc b/src/rgw/rgw_object_expirer_core.cc index bce6ce4882f..b2e302baab6 100644 --- a/src/rgw/rgw_object_expirer_core.cc +++ b/src/rgw/rgw_object_expirer_core.cc @@ -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) -- 2.39.5