From: Shilpa Jagannath Date: Tue, 11 Apr 2023 15:13:25 +0000 (-0400) Subject: rgw/multisite: use intrusive_ptr instead of raw ptr for notify_stack X-Git-Tag: v19.0.0~1234^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=410246f7aa81c960e0c4a4133602c02ac9bf59fc;p=ceph-ci.git rgw/multisite: use intrusive_ptr instead of raw ptr for notify_stack Signed-off-by: Shilpa Jagannath --- diff --git a/src/rgw/driver/rados/rgw_sync.cc b/src/rgw/driver/rados/rgw_sync.cc index 98ee31c98e1..262e00ba9dc 100644 --- a/src/rgw/driver/rados/rgw_sync.cc +++ b/src/rgw/driver/rados/rgw_sync.cc @@ -1396,7 +1396,6 @@ public: class RGWMetaSyncShardCR : public RGWCoroutine { RGWMetaSyncEnv *sync_env; - rgw_meta_sync_info sync_info; const rgw_pool& pool; const std::string& period; //< currently syncing period id const epoch_t realm_epoch; //< realm_epoch of period @@ -1988,7 +1987,7 @@ class RGWMetaSyncCR : public RGWCoroutine { using ControlCRRef = boost::intrusive_ptr; using StackRef = boost::intrusive_ptr; using RefPair = std::pair; - RGWCoroutinesStack *notify_stack; + boost::intrusive_ptr notify_stack; map shard_crs; int ret{0}; @@ -2006,7 +2005,7 @@ public: reenter(this) { yield { ldpp_dout(dpp, 10) << "broadcast sync lock notify" << dendl; - notify_stack = spawn(new RGWMetaSyncShardNotifyCR(sync_env, tn), false); + notify_stack.reset(spawn(new RGWMetaSyncShardNotifyCR(sync_env, tn), false)); } // loop through one period at a time @@ -2069,7 +2068,7 @@ public: yield wait_for_child(); collect(&ret, nullptr); } - drain_all_but_stack(notify_stack); + drain_all_but_stack(notify_stack.get()); { // drop shard cr refs under lock std::lock_guard lock(mutex); @@ -2089,7 +2088,7 @@ public: rgw_raw_obj(pool, sync_env->status_oid()), sync_status.sync_info)); } - notify_stack->cancel(); + notify_stack.get()->cancel(); drain_all(); }