]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: remove spawned_keys filter from incremental data sync 33270/head
authorCasey Bodley <cbodley@redhat.com>
Tue, 7 Jan 2020 18:30:51 +0000 (13:30 -0500)
committerNathan Cutler <ncutler@suse.com>
Thu, 13 Feb 2020 13:53:49 +0000 (14:53 +0100)
the spawned_keys filtering is valid "as long as we don't yield",
according to code comments. however, proper enforcement of the
spawn window necessitates yielding when we exceed that window

the key-based filtering provided by spawned_keys is actually already
satisfied by the call to marker_tracker->index_key_to_marker(), which
also takes completions (either from try_update_high_marker() or
finish()) into account

Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 3e2795fd8f14afdab909c3a15b65f47f390b2230)

src/rgw/rgw_data_sync.cc

index bad204699ece1382618079d1ad0452cb04a7ca21..3f70ff8481b522a2693cfe80ebfded4f44967e46 100644 (file)
@@ -1146,8 +1146,6 @@ class RGWDataSyncShardCR : public RGWCoroutine {
 
   bool *reset_backoff;
 
-  set<string> spawned_keys;
-
   boost::intrusive_ptr<RGWContinuousLeaseCR> lease_cr;
   boost::intrusive_ptr<RGWCoroutinesStack> lease_stack;
   string status_oid;
@@ -1417,9 +1415,7 @@ public:
         }
         omapkeys.reset();
 
-#define INCREMENTAL_MAX_ENTRIES 100
         tn->log(20, SSTR("shard_id=" << shard_id << " sync_marker=" << sync_marker.marker));
-        spawned_keys.clear();
         yield call(new RGWReadRemoteDataLogShardCR(sync_env, shard_id, sync_marker.marker,
                                                    &next_marker, &log_entries, &truncated));
         if (retcode < 0 && retcode != -ENOENT) {
@@ -1443,18 +1439,7 @@ 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 {
-            /*
-             * don't spawn the same key more than once. We can do that as long as we don't yield
-             */
-            if (spawned_keys.find(log_iter->entry.key) == spawned_keys.end()) {
-              spawned_keys.insert(log_iter->entry.key);
-              spawn(new RGWDataSyncSingleEntryCR(sync_env, log_iter->entry.key, log_iter->log_id, marker_tracker, error_repo, false, tn), false);
-              if (retcode < 0) {
-                stop_spawned_services();
-                drain_all();
-                return set_cr_error(retcode);
-              }
-            }
+            spawn(new RGWDataSyncSingleEntryCR(sync_env, log_iter->entry.key, log_iter->log_id, marker_tracker, error_repo, false, tn), false);
           }
           while ((int)num_spawned() > spawn_window) {
             set_status() << "num_spawned() > spawn_window";