From: Casey Bodley Date: Fri, 4 Nov 2016 16:18:32 +0000 (-0400) Subject: rgw: delete entries_index in RGWFetchAllMetaCR X-Git-Tag: v10.2.6~46^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=73cef9f5c08142f1a3f1dbfb2153e5ee997fe39b;p=ceph.git rgw: delete entries_index in RGWFetchAllMetaCR use a unique_ptr to ensure the entries_index is freed on destruction Fixes: http://tracker.ceph.com/issues/17812 Signed-off-by: Casey Bodley (cherry picked from commit 9c731ed6b606e39000025ab569f412ece0cc7fce) --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 3d494efed65e..1a404c785f45 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -733,7 +733,7 @@ class RGWFetchAllMetaCR : public RGWCoroutine { list result; list::iterator iter; - RGWShardedOmapCRManager *entries_index; + std::unique_ptr entries_index; RGWContinuousLeaseCR *lease_cr; RGWCoroutinesStack *lease_stack; @@ -746,7 +746,7 @@ public: RGWFetchAllMetaCR(RGWMetaSyncEnv *_sync_env, int _num_shards, map& _markers) : RGWCoroutine(_sync_env->cct), sync_env(_sync_env), num_shards(_num_shards), - ret_status(0), entries_index(NULL), lease_cr(nullptr), lease_stack(nullptr), + ret_status(0), lease_cr(nullptr), lease_stack(nullptr), lost_lock(false), failed(false), markers(_markers) { } @@ -803,9 +803,9 @@ public: set_sleeping(true); yield; } - entries_index = new RGWShardedOmapCRManager(sync_env->async_rados, sync_env->store, this, num_shards, - sync_env->store->get_zone_params().log_pool, - mdlog_sync_full_sync_index_prefix); + entries_index.reset(new RGWShardedOmapCRManager(sync_env->async_rados, sync_env->store, this, num_shards, + sync_env->store->get_zone_params().log_pool, + mdlog_sync_full_sync_index_prefix)); yield { call(new RGWReadRESTResourceCR >(cct, conn, sync_env->http_manager, "/admin/metadata", NULL, §ions));