From: Casey Bodley Date: Tue, 13 Jul 2021 17:18:27 +0000 (-0400) Subject: rgw: limit concurrency of metadata sync X-Git-Tag: v17.1.0~1336^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=a07add0a5408f0480e93ea5920bc013119ba6401;p=ceph.git rgw: limit concurrency of metadata sync limit the number of concurrent RGWMetaSyncSingleEntryCRs that each mdlog shard is allowed to spawn. use META_SYNC_SPAWN_WINDOW=20 to match data- and bucket sync Signed-off-by: Casey Bodley --- diff --git a/src/rgw/rgw_sync.cc b/src/rgw/rgw_sync.cc index 233a827ab326..2689f6ea1088 100644 --- a/src/rgw/rgw_sync.cc +++ b/src/rgw/rgw_sync.cc @@ -1393,6 +1393,8 @@ public: int state_store_mdlog_entries_complete(); }; +#define META_SYNC_SPAWN_WINDOW 20 + class RGWMetaSyncShardCR : public RGWCoroutine { RGWMetaSyncEnv *sync_env; @@ -1622,6 +1624,11 @@ public: stack_to_pos[stack] = marker; pos_to_prev[marker] = marker; } + // limit spawn window + while (num_spawned() > META_SYNC_SPAWN_WINDOW) { + yield wait_for_child(); + collect_children(); + } } } collect_children(); @@ -1810,6 +1817,11 @@ public: stack_to_pos[stack] = log_iter->id; pos_to_prev[log_iter->id] = marker; } + // limit spawn window + while (num_spawned() > META_SYNC_SPAWN_WINDOW) { + yield wait_for_child(); + collect_children(); + } } marker = log_iter->id; }