]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: limit concurrency of metadata sync
authorCasey Bodley <cbodley@redhat.com>
Tue, 13 Jul 2021 17:18:27 +0000 (13:18 -0400)
committerCory Snyder <csnyder@iland.com>
Wed, 4 Aug 2021 16:38:25 +0000 (12:38 -0400)
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 <cbodley@redhat.com>
(cherry picked from commit a07add0a5408f0480e93ea5920bc013119ba6401)

src/rgw/rgw_sync.cc

index 32464e896e9285ff893080f25542076d9c22c93c..8eacd150fd06e4777538389a67b97bee87e88f2e 100644 (file)
@@ -1394,6 +1394,8 @@ public:
   int state_store_mdlog_entries_complete();
 };
 
+#define META_SYNC_SPAWN_WINDOW 20
+
 class RGWMetaSyncShardCR : public RGWCoroutine {
   RGWMetaSyncEnv *sync_env;
 
@@ -1623,6 +1625,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();
@@ -1811,6 +1818,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;
           }