]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: fix marker comparison to detect end of mdlog period
authorCasey Bodley <cbodley@redhat.com>
Tue, 7 Mar 2017 16:16:43 +0000 (11:16 -0500)
committerCasey Bodley <cbodley@redhat.com>
Wed, 26 Apr 2017 12:51:01 +0000 (08:51 -0400)
Fixes: http://tracker.ceph.com/issues/18639
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_sync.cc

index be1fa2fdd887ce39f5ec34a8cf57dea741e30a19..0aad40c23bb5a619f38b89c12bdbbb7524c81e83 100644 (file)
@@ -1602,10 +1602,16 @@ public:
             *reset_backoff = false; // back off and try again later
             return retcode;
           }
-          for (log_iter = log_entries.begin(); log_iter != log_entries.end(); ++log_iter) {
-            if (!period_marker.empty() && period_marker < log_iter->id) {
+          for (log_iter = log_entries.begin(); log_iter != log_entries.end() && !done_with_period; ++log_iter) {
+            if (!period_marker.empty() && period_marker <= log_iter->id) {
               done_with_period = true;
-              break;
+              if (period_marker < log_iter->id) {
+                ldout(cct, 10) << "found key=" << log_iter->id
+                    << " past period_marker=" << period_marker << dendl;
+                break;
+              }
+              ldout(cct, 10) << "found key at period_marker=" << period_marker << dendl;
+              // sync this entry, then return control to RGWMetaSyncCR
             }
             if (!mdlog_entry.convert_from(*log_iter)) {
               ldout(sync_env->cct, 0) << __func__ << ":" << __LINE__ << ": ERROR: failed to convert mdlog entry, shard_id=" << shard_id << " log_entry: " << log_iter->id << ":" << log_iter->section << ":" << log_iter->name << ":" << log_iter->timestamp << " ... skipping entry" << dendl;