]> git.apps.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)
committerNathan Cutler <ncutler@suse.com>
Thu, 28 Jan 2021 15:45:32 +0000 (16:45 +0100)
Signed-off-by: Prasad Krishnan <prasad.krishnan@flipkart.com>
(cherry picked from commit f92cfaf74f1eb8809653867b8c67a3ace37619f2)

src/rgw/rgw_rados.cc

index e978f083b25d5098e5e72936239a58f9009132d0..8309804eb42ea4e6d48b1bff0430f1f1fcf806d5 100644 (file)
@@ -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 */