From 8bb877e1636b84ae2c569c9a6ea153b6cdbdaf36 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Wed, 15 Aug 2018 16:04:37 -0400 Subject: [PATCH] rgw: incremental data sync uses truncated flag to detect end of listing 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 (cherry picked from commit fb2b618658d8ff9c311838f59e396ab24c21e9e8) Signed-off-by: Jonathan Brielmaier Conflicts: src/rgw/rgw_data_sync.cc: write log with ldout --- src/rgw/rgw_data_sync.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 5aac1833bbe..bbb0973e92b 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1429,8 +1429,8 @@ public: } } } - ldout(sync_env->cct, 20) << __func__ << ":" << __LINE__ << ": shard_id=" << shard_id << " datalog_marker=" << datalog_marker << " sync_marker.marker=" << sync_marker.marker << dendl; - if (datalog_marker == sync_marker.marker || remote_trimmed == RemoteTrimmed) { + ldout(sync_env->cct, 20) << __func__ << ":" << __LINE__ << ": shard_id=" << shard_id << " datalog_marker=" << datalog_marker << " sync_marker.marker=" << sync_marker.marker << " truncated=" << truncated << dendl; + if (!truncated) { #define INCREMENTAL_INTERVAL 20 yield wait(utime_t(INCREMENTAL_INTERVAL, 0)); } -- 2.47.3