]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: data sync uses yield_spawn_window() 45714/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 22 Mar 2022 20:42:55 +0000 (16:42 -0400)
committerCasey Bodley <cbodley@redhat.com>
Wed, 30 Mar 2022 17:31:23 +0000 (13:31 -0400)
restore concurrency to RGWDataSyncShardCR by replacing
drain_all_but_stack_cb() with yield_spawn_window()

Fixes: https://tracker.ceph.com/issues/55000
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit bfe9bd3aac4495763ca44c0995ca614e61d879ae)

src/rgw/rgw_data_sync.cc

index 1e988d4ce33f11ef97de7ec8ab19d0e9ca8d124b..d50572653c3681a0a66a9fad126f3b7f7a2b6cad 100644 (file)
@@ -1592,17 +1592,11 @@ public:
             tn->log(0, SSTR("ERROR: cannot start syncing " << iter->first << ". Duplicate entry?"));
           } else {
             // fetch remote and write locally
-            spawn(sync_single_entry(source_bs, iter->first, iter->first,
-                                    entry_timestamp, false), false);
+            yield_spawn_window(sync_single_entry(source_bs, iter->first, iter->first,
+                                                 entry_timestamp, false),
+                               spawn_window, std::nullopt);
           }
           sync_marker.marker = iter->first;
-
-          drain_all_but_stack_cb(lease_stack.get(),
-                                 [&](uint64_t stack_id, int ret) {
-                                   if (ret < 0) {
-                                     tn->log(10, "a sync operation returned error");
-                                   }
-                                 });
         }
       } while (omapvals->more);
       omapvals.reset();
@@ -1747,16 +1741,10 @@ public:
           if (!marker_tracker->start(log_iter->log_id, 0, log_iter->log_timestamp)) {
             tn->log(0, SSTR("ERROR: cannot start syncing " << log_iter->log_id << ". Duplicate entry?"));
           } else {
-            spawn(sync_single_entry(source_bs, log_iter->entry.key, log_iter->log_id,
-                                    log_iter->log_timestamp, false), false);
+            yield_spawn_window(sync_single_entry(source_bs, log_iter->entry.key, log_iter->log_id,
+                                                 log_iter->log_timestamp, false),
+                               spawn_window, std::nullopt);
           }
-
-          drain_all_but_stack_cb(lease_stack.get(),
-                                 [&](uint64_t stack_id, int ret) {
-                                   if (ret < 0) {
-                                     tn->log(10, "a sync operation returned error");
-                                   }
-                                 });
         }
 
         tn->log(20, SSTR("shard_id=" << shard_id << " sync_marker=" << sync_marker.marker