From 90fdffdae18c8d0509f923fc0d1996f10a529a28 Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Thu, 31 May 2018 14:11:07 -0400 Subject: [PATCH] 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) --- src/rgw/rgw_data_sync.cc | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index 439951e1a076b..a37a0552150f2 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -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); } -- 2.47.3