From: Shilpa Jagannath Date: Wed, 10 Jul 2024 19:07:13 +0000 (-0400) Subject: rgw/multisite: remove source object's RGW_ATTR_OBJ_REPLICATION_TRACE during copy_object. X-Git-Tag: v18.2.5~330^2~1 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=60e9fc7c3de4cae7b7e41ee571f2489fb41ef61a;p=ceph.git rgw/multisite: remove source object's RGW_ATTR_OBJ_REPLICATION_TRACE during copy_object. if a copy_object is executed on a replicated object, it fails to sync the copied object to the original source zone where the source object was first written and replicated from. this is because copy_object retains source attrs by default. when a get_obj() is issued from a fetch_remote_obj() call during sync, we check for this RGW_ATTR_OBJ_REPLICATION_TRACE and if that destination zone is already present in the trace, we return NOT_MODIFIED error, thus failing to replicate the copied object. also remove RGW_ATTR_OBJ_REPLICATION_STATUS and RGW_ATTR_OBJ_REPLICATION_TIMESTAMP Signed-off-by: Shilpa Jagannath (cherry picked from commit 46eef5fb5c06ac1af723cba0e3c3980fb6a431ce) --- diff --git a/src/rgw/driver/rados/rgw_rados.cc b/src/rgw/driver/rados/rgw_rados.cc index 566b7d6c2f9f0..373c3e8bf6679 100644 --- a/src/rgw/driver/rados/rgw_rados.cc +++ b/src/rgw/driver/rados/rgw_rados.cc @@ -4418,6 +4418,10 @@ int RGWRados::copy_obj(RGWObjectCtx& obj_ctx, src_attrs.erase(RGW_ATTR_OLH_VER); } + src_attrs.erase(RGW_ATTR_OBJ_REPLICATION_TRACE); + src_attrs.erase(RGW_ATTR_OBJ_REPLICATION_TIMESTAMP); + src_attrs.erase(RGW_ATTR_OBJ_REPLICATION_STATUS); + set_copy_attrs(src_attrs, attrs, attrs_mod); attrs.erase(RGW_ATTR_ID_TAG); attrs.erase(RGW_ATTR_PG_VER);