]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: bucket sync doesn't squash over olh entries
authorCasey Bodley <cbodley@redhat.com>
Thu, 31 May 2018 18:11:07 +0000 (14:11 -0400)
committerNathan Cutler <ncutler@suse.com>
Wed, 12 Sep 2018 11:27:21 +0000 (13:27 +0200)
all bucket index operations that mutate the olh_epoch must be applied
by sync to keep it consistent between zones. avoid squashing later
operations on the same object version

Fixes: http://tracker.ceph.com/issues/24367
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 08cd49ab5cdb50565c554adb586a2230cd058d42)

src/rgw/rgw_data_sync.cc

index 439951e1a076b123769a56dded3630ac23e403b7..a37a0552150f22919045eba5b0fe15cd5a2c93b8 100644 (file)
@@ -2687,6 +2687,10 @@ int RGWBucketShardFullSyncCR::operate()
   return 0;
 }
 
+static bool has_olh_epoch(RGWModifyOp op) {
+  return op == CLS_RGW_OP_LINK_OLH || op == CLS_RGW_OP_UNLINK_INSTANCE;
+}
+
 class RGWBucketShardIncrementalSyncCR : public RGWCoroutine {
   RGWDataSyncEnv *sync_env;
   const rgw_bucket_shard& bs;
@@ -2777,6 +2781,10 @@ int RGWBucketShardIncrementalSyncCR::operate()
           continue;
         }
         auto& squash_entry = squash_map[make_pair(e.object, e.instance)];
+        // don't squash over olh entries - we need to apply their olh_epoch
+        if (has_olh_epoch(squash_entry.second) && !has_olh_epoch(e.op)) {
+          continue;
+        }
         if (squash_entry.first <= e.timestamp) {
           squash_entry = make_pair<>(e.timestamp, e.op);
         }