]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw/multisite: in order to sleep between mdlog polling events, we check if the mdlog_... wip-rgw-mdlog-polling 52400/head
authorShilpa Jagannath <smanjara@redhat.com>
Tue, 27 Jun 2023 20:32:32 +0000 (16:32 -0400)
committerShilpa Jagannath <smanjara@redhat.com>
Tue, 11 Jul 2023 16:28:23 +0000 (12:28 -0400)
mdlog_marker and max_marker. but max_marker is exposed to changes from RGWReadMDLogEntriesCR, and if there is a race
coming from mdlog trimming which could render max_marker empty, then its comparison with mdlog polling can be incorrect.
To fix this, we now save the previous mdlog marker and compare with the updated mdlog marker.

Signed-off-by: Shilpa Jagannath <smanjara@redhat.com>
src/rgw/driver/rados/rgw_sync.cc

index 262e00ba9dc20634c854c1673a92403e9a6f74a6..4b3f87e57e6225bbbc4fcffedd909f2d16d1c314 100644 (file)
@@ -1446,6 +1446,7 @@ class RGWMetaSyncShardCR : public RGWCoroutine {
   bool done_with_period = false;
 
   int total_entries = 0;
+  string old_mdlog_marker;
 
   RGWSyncTraceNodeRef tn;
 public:
@@ -1797,6 +1798,7 @@ public:
        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;
+          old_mdlog_marker = mdlog_marker;
           yield call(new RGWCloneMetaLogCoroutine(sync_env, mdlog,
                                                   period, shard_id,
                                                   mdlog_marker, &mdlog_marker));
@@ -1867,7 +1869,8 @@ public:
           tn->log(10, SSTR(*this << ": done with period"));
           break;
         }
-       if (mdlog_marker == max_marker && can_adjust_marker) {
+       if (mdlog_marker == old_mdlog_marker && can_adjust_marker) {
+          tn->log(20, SSTR("mdlog_marker=" << mdlog_marker << " old_marker=" << old_marker));
           tn->unset_flag(RGW_SNS_FLAG_ACTIVE);
          yield wait(utime_t(cct->_conf->rgw_meta_sync_poll_interval, 0));
        }