From e711cf319fa12ec7b03edda769685353e24cbfcb Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 9 Oct 2017 14:08:21 -0400 Subject: [PATCH] rgw: ListBucketIndexesCR spawns entries_index after listing metadata if the metadata listing fails, we won't have to clean up entries_index Signed-off-by: Casey Bodley (cherry picked from commit 7f127f54406ef0e08a1265b9bc20433fe3f21523) --- src/rgw/rgw_data_sync.cc | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 8fe6497f29b61..088259b5afafc 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -735,9 +735,6 @@ public: int operate() override { reenter(this) { - entries_index = new RGWShardedOmapCRManager(sync_env->async_rados, store, this, num_shards, - store->get_zone_params().log_pool, - oid_prefix); yield { string entrypoint = string("/admin/metadata/bucket.instance"); /* FIXME: need a better scaling solution here, requires streaming output */ @@ -748,6 +745,10 @@ public: ldout(sync_env->cct, 0) << "ERROR: failed to fetch metadata for section bucket.index" << dendl; return set_state(RGWCoroutine_Error); } + entries_index = new RGWShardedOmapCRManager(sync_env->async_rados, store, this, num_shards, + store->get_zone_params().log_pool, + oid_prefix); + yield; // yield so OmapAppendCRs can start for (iter = result.begin(); iter != result.end(); ++iter) { ldout(sync_env->cct, 20) << "list metadata: section=bucket.index key=" << *iter << dendl; -- 2.39.5