From: Casey Bodley Date: Tue, 22 Jan 2019 17:04:43 +0000 (-0500) Subject: rgw: bucket full sync handles delete markers X-Git-Tag: v12.2.12~88^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=9c9e004a6d79ccfac76794bb563091c1e2730ae6;p=ceph.git rgw: bucket full sync handles delete markers full sync uses CLS_RGW_OP_LINK_OLH_DM for delete markers instead of trying to fetch them from the source zone Fixes: http://tracker.ceph.com/issues/38007 Signed-off-by: Casey Bodley (cherry picked from commit 5ffd34c5a6a9bbdba086eb57cded915b879513d4) Conflicts: src/rgw/rgw_data_sync.cc sync tracing --- diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index ad43157824e..088f3aa8dcc 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -2229,6 +2229,16 @@ struct bucket_list_entry { JSONDecoder::decode_json("VersionedEpoch", versioned_epoch, obj); JSONDecoder::decode_json("RgwxTag", rgw_tag, obj); } + + RGWModifyOp get_modify_op() const { + if (delete_marker) { + return CLS_RGW_OP_LINK_OLH_DM; + } else if (!key.instance.empty() && key.instance != "null") { + return CLS_RGW_OP_LINK_OLH; + } else { + return CLS_RGW_OP_ADD; + } + } }; struct bucket_list_result { @@ -2607,7 +2617,6 @@ class RGWBucketShardFullSyncCR : public RGWCoroutine { RGWBucketFullSyncShardMarkerTrack marker_tracker; rgw_obj_key list_marker; bucket_list_entry *entry{nullptr}; - RGWModifyOp op{CLS_RGW_OP_ADD}; int total_entries{0}; @@ -2669,12 +2678,11 @@ int RGWBucketShardFullSyncCR::operate() if (!marker_tracker.start(entry->key, total_entries, real_time())) { ldout(sync_env->cct, 0) << "ERROR: cannot start syncing " << entry->key << ". Duplicate entry?" << dendl; } else { - op = (entry->key.instance.empty() || entry->key.instance == "null" ? CLS_RGW_OP_ADD : CLS_RGW_OP_LINK_OLH); using SyncCR = RGWBucketSyncSingleEntryCR; yield spawn(new SyncCR(sync_env, bucket_info, bs, entry->key, false, /* versioned, only matters for object removal */ entry->versioned_epoch, entry->mtime, - entry->owner, op, CLS_RGW_STATE_COMPLETE, + entry->owner, entry->get_modify_op(), CLS_RGW_STATE_COMPLETE, entry->key, &marker_tracker, zones_trace), false); }