]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: read incremental metalog from master cluster based on truncate variable
authorgengjichao <gengjichao@jd.com>
Mon, 20 Jul 2020 02:33:00 +0000 (10:33 +0800)
committerCasey Bodley <cbodley@redhat.com>
Mon, 15 May 2023 18:52:05 +0000 (14:52 -0400)
when the log entry in the meta.log object of the secondary cluster is empty,
the value of max_marker is also empty,which can't meet the requirement that
mdlog_marker <= max_marker,resulting in that the secondary cluster can't fetch
new log entry from the master cluster and infinite loop,finally, the secondary
cluster's metadata can't catch up the master cluster. when the truncate is false,
it means that the secondary cluster's meta.log is empyt,we can read more from
master cluster.

Fixes: https://tracker.ceph.com/issues/46563
Signed-off-by: gengjichao <gengjichao@jd.com>
(cherry picked from commit 2ed1c3e28a326e1422b0b6af47dd0af300ae85a2)
(cherry picked from commit 3b61154d39d6c4a1f29c6464e588589155982fcd)

src/rgw/rgw_sync.cc

index bcf2bc230b38892aa03508c717ad56e9d61717df..6cf50171836bf515d0b1d886c83e27404e455463 100644 (file)
@@ -1762,13 +1762,13 @@ public:
           break;
         }
 #define INCREMENTAL_MAX_ENTRIES 100
-        ldpp_dout(sync_env->dpp, 20) << __func__ << ":" << __LINE__ << ": shard_id=" << shard_id << " mdlog_marker=" << mdlog_marker << " sync_marker.marker=" << sync_marker.marker << " period_marker=" << period_marker << dendl;
+        ldpp_dout(sync_env->dpp, 20) << __func__ << ":" << __LINE__ << ": shard_id=" << shard_id << " mdlog_marker=" << mdlog_marker << " sync_marker.marker=" << sync_marker.marker << " period_marker=" << period_marker << " truncated=" << truncated << dendl;
         if (!period_marker.empty() && period_marker <= mdlog_marker) {
           tn->log(10, SSTR("finished syncing current period: mdlog_marker=" << mdlog_marker << " sync_marker=" << sync_marker.marker << " period_marker=" << period_marker));
           done_with_period = true;
           break;
         }
-       if (mdlog_marker <= max_marker) {
+       if (mdlog_marker <= max_marker || !truncated) {
          /* we're at the tip, try to bring more entries */
           ldpp_dout(sync_env->dpp, 20) << __func__ << ":" << __LINE__ << ": shard_id=" << shard_id << " syncing mdlog for shard_id=" << shard_id << dendl;
           yield call(new RGWCloneMetaLogCoroutine(sync_env, mdlog,