]> 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)
committerCasey Bodley <cbodley@redhat.com>
Wed, 15 Aug 2018 20:33:34 +0000 (16:33 -0400)
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>
src/rgw/rgw_data_sync.cc

index a19dc8c7b06c36f2be1e015ccb687d66a6b62937..49ab5b099c76a1156863fef88245fc2c6e309d08 100644 (file)
@@ -1511,8 +1511,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);
 #define INCREMENTAL_INTERVAL 20
          yield wait(utime_t(INCREMENTAL_INTERVAL, 0));