From: Casey Bodley Date: Thu, 31 May 2018 18:11:07 +0000 (-0400) Subject: rgw: bucket sync doesn't squash over olh entries X-Git-Tag: v13.2.2~92^2~4 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=d16a8d5d2e42f9410326a29dd0df9fad6525ab55;p=ceph.git rgw: bucket sync doesn't squash over olh entries 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 (cherry picked from commit 08cd49ab5cdb50565c554adb586a2230cd058d42) --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 2a19e12b6352..d6a989a28d45 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2838,6 +2838,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; @@ -2937,6 +2941,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); }