]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
RGW:Multisite: Check rgw_sync_obj_etag_verify option only once
authorPrasad Krishnan <prasad.krishnan@flipkart.com>
Tue, 24 Mar 2020 18:19:59 +0000 (18:19 +0000)
committerYang Honggang <yanghonggang@kuaishou.com>
Wed, 10 Feb 2021 11:59:38 +0000 (19:59 +0800)
Signed-off-by: Prasad Krishnan <prasad.krishnan@flipkart.com>
(cherry picked from commit f92cfaf74f1eb8809653867b8c67a3ace37619f2)

src/rgw/rgw_rados.cc

index 3d3719576ea56dde33e254f495fcf633a5c00b28..b3bba1b844698e8a7e7269e910aebadf184894c3 100644 (file)
@@ -4126,6 +4126,10 @@ public:
       return "";
     }
   }
+
+  SourceObjType get_obj_type() {
+    return obj_type;
+  }
 };
 
 /*
@@ -4608,7 +4612,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 */