From 6bb98234a99ecf56f6413ad061f6dd1ded1311fc Mon Sep 17 00:00:00 2001 From: Prasad Krishnan Date: Tue, 24 Mar 2020 18:19:59 +0000 Subject: [PATCH] RGW:Multisite: Check rgw_sync_obj_etag_verify option only once Signed-off-by: Prasad Krishnan (cherry picked from commit f92cfaf74f1eb8809653867b8c67a3ace37619f2) --- src/rgw/rgw_rados.cc | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/rgw/rgw_rados.cc b/src/rgw/rgw_rados.cc index e978f083b25d5..8309804eb42ea 100644 --- a/src/rgw/rgw_rados.cc +++ b/src/rgw/rgw_rados.cc @@ -3463,6 +3463,10 @@ public: return ""; } } + + SourceObjType get_obj_type() { + return obj_type; + } }; /* @@ -4016,7 +4020,8 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx, set_mtime_weight.init(set_mtime, svc.zone->get_zone_short_id(), pg_ver); } - if (cct->_conf->rgw_sync_obj_etag_verify) { + /* Perform ETag verification is we have computed the object's MD5 sum at our end */ + if (cb.get_obj_type() != OBJ_TYPE_UNINIT) { string trimmed_etag = etag; /* Remove the leading and trailing double quotes from etag */ -- 2.39.5