]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: incremental data sync uses truncated flag to detect end of listing
authorCasey Bodley <cbodley@redhat.com>
Wed, 15 Aug 2018 20:04:37 +0000 (16:04 -0400)
committerNathan Cutler <ncutler@suse.com>
Tue, 23 Oct 2018 06:12:53 +0000 (08:12 +0200)
we call wait() after incremental sync if we've reached the end of the
datalog listing. the existing logic compares our local marker with the
remote's high marker, with some extra code to handle the case where the
remote log was trimmed

all of this can be simplified by using the 'truncated' flag returned
with the RGWReadRemoteDataLogShardCR used to list the remote datalog

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

src/rgw/rgw_data_sync.cc

index 6d6365999dfc63783483225fe6d8e621b75ac99c..30b7bfcfbca18852622b38eaeb6a69c228d1511f 100644 (file)
@@ -1531,8 +1531,9 @@ public:
             }
           }
        }
-       tn->log(20, SSTR("shard_id=" << shard_id << " datalog_marker=" << datalog_marker << " sync_marker.marker=" << sync_marker.marker));
-       if (datalog_marker == sync_marker.marker || remote_trimmed == RemoteTrimmed) {
+       tn->log(20, SSTR("shard_id=" << shard_id << " datalog_marker=" << datalog_marker << " sync_marker.marker=" << sync_marker.marker << " truncated=" << truncated));
+       if (!truncated) {
+          // we reached the end, wait a while before checking for more
           tn->unset_flag(RGW_SNS_FLAG_ACTIVE);
          yield wait(get_idle_interval());
        }