From 966dd3eec40ddfe1896dc91e919bac1357391e0f Mon Sep 17 00:00:00 2001 From: Yehuda Sadeh Date: Thu, 8 Oct 2015 20:52:17 -0700 Subject: [PATCH] rgw: propagate olh_epoch for obj sync correctly Signed-off-by: Yehuda Sadeh --- src/rgw/rgw_data_sync.cc | 12 +++++++++--- src/rgw/rgw_rados.cc | 1 + 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_data_sync.cc b/src/rgw/rgw_data_sync.cc index c472c44ba4c25..7fddbc6969922 100644 --- a/src/rgw/rgw_data_sync.cc +++ b/src/rgw/rgw_data_sync.cc @@ -1766,20 +1766,26 @@ public: reenter(this) { yield { int r; - if (op == CLS_RGW_OP_ADD) { + if (op == CLS_RGW_OP_ADD || + op == CLS_RGW_OP_LINK_OLH) { + if (op == CLS_RGW_OP_ADD && !key.instance.empty()) { + ldout(store->ctx(), 10) << "bucket skipping sync obj: " << source_zone << "/" << bucket_info->bucket << "/" << key << "[" << versioned_epoch << "]: versioned object will be synced on link_olh" << dendl; + return set_state(RGWCoroutine_Done, 0); + + } ldout(store->ctx(), 5) << "bucket sync: sync obj: " << source_zone << "/" << bucket_info->bucket << "/" << key << "[" << versioned_epoch << "]" << dendl; r = call(new RGWFetchRemoteObjCR(async_rados, store, source_zone, *bucket_info, key, versioned_epoch, true)); if (r < 0) { ldout(store->ctx(), 0) << "ERROR: failed to call RGWFetchRemoteObjCR()" << dendl; - return r; + return set_state(RGWCoroutine_Error, r); } } else if (op == CLS_RGW_OP_DEL) { r = call(new RGWRemoveObjCR(async_rados, store, source_zone, *bucket_info, key, versioned_epoch, ×tamp)); if (r < 0) { ldout(store->ctx(), 0) << "ERROR: failed to call RGWRemoveObjCR()" << dendl; - return r; + return set_state(RGWCoroutine_Error, r); } } } diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index 4aaec1e15b5b3..93f60be2a3b29 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -5253,6 +5253,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, dest_bucket_info, dest_obj.bucket, dest_obj.get_orig_obj(), cct->_conf->rgw_obj_stripe_size, tag, dest_bucket_info.versioning_enabled()); processor.set_version_id(dest_obj.get_instance()); + processor.set_olh_epoch(olh_epoch); int ret = processor.prepare(this, NULL); if (ret < 0) { return ret; -- 2.39.5