]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: data sync skips slo data when syncing the manifest object 13561/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 Mar 2017 21:31:34 +0000 (16:31 -0500)
committerCasey Bodley <cbodley@redhat.com>
Thu, 23 Mar 2017 16:23:25 +0000 (12:23 -0400)
Fixes: http://tracker.ceph.com/issues/19027
Signed-off-by: Casey Bodley <cbodley@redhat.com>
src/rgw/rgw_rados.cc
src/rgw/rgw_rest_conn.cc
src/rgw/rgw_rest_conn.h
src/rgw/rgw_rest_s3.cc
src/rgw/rgw_rest_s3.h

index da90e7afaeef65028a4983873c27f0c01bab682c..205e4feac13bbbe524ce3a65890ec91bc42066ea 100644 (file)
@@ -7001,7 +7001,7 @@ int RGWRados::stat_remote_obj(RGWObjectCtx& obj_ctx,
   int ret = conn->get_obj(user_id, info, src_obj, pmod, unmod_ptr,
                       dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver,
                       true /* prepend_meta */, true /* GET */, true /* rgwx-stat */,
-                      &cb, &in_stream_req);
+                      true /* sync manifest */, &cb, &in_stream_req);
   if (ret < 0) {
     return ret;
   }
@@ -7180,7 +7180,7 @@ int RGWRados::fetch_remote_obj(RGWObjectCtx& obj_ctx,
   ret = conn->get_obj(user_id, info, src_obj, pmod, unmod_ptr,
                       dest_mtime_weight.zone_short_id, dest_mtime_weight.pg_ver,
                       true /* prepend_meta */, true /* GET */, false /* rgwx-stat */,
-                      &cb, &in_stream_req);
+                      true /* sync manifest */, &cb, &in_stream_req);
   if (ret < 0) {
     goto set_err_state;
   }
index f7bfb3984b628b8bfdba62dee0a4c8d8f525dd4a..8699624002b5518e95d321ef39eb33657251fe64 100644 (file)
@@ -129,7 +129,8 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw
                          const real_time *mod_ptr, const real_time *unmod_ptr,
                          uint32_t mod_zone_id, uint64_t mod_pg_ver,
                          bool prepend_metadata, bool get_op, bool rgwx_stat,
-                         RGWGetDataCB *cb, RGWRESTStreamRWRequest **req)
+                         bool sync_manifest, RGWGetDataCB *cb,
+                         RGWRESTStreamRWRequest **req)
 {
   string url;
   int ret = get_url(url);
@@ -144,6 +145,9 @@ int RGWRESTConn::get_obj(const rgw_user& uid, req_info *info /* optional */, rgw
   if (rgwx_stat) {
     params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "stat", "true"));
   }
+  if (sync_manifest) {
+    params.push_back(param_pair_t(RGW_SYS_PARAM_PREFIX "sync-manifest", ""));
+  }
   if (!obj.key.instance.empty()) {
     const string& instance = obj.key.instance;
     params.push_back(param_pair_t("versionId", instance));
index 38d1d3364218ce8b54d4dd7b71e818b72db6d2e7..674387ffa05e12d4bd4ab0d6aa9456d0dde2f1c8 100644 (file)
@@ -88,7 +88,7 @@ public:
   int get_obj(const rgw_user& uid, req_info *info /* optional */, rgw_obj& obj,
               const ceph::real_time *mod_ptr, const ceph::real_time *unmod_ptr,
               uint32_t mod_zone_id, uint64_t mod_pg_ver,
-              bool prepend_metadata, bool get_op, bool rgwx_stat,
+              bool prepend_metadata, bool get_op, bool rgwx_stat, bool sync_manifest,
               RGWGetDataCB *cb, RGWRESTStreamRWRequest **req);
   int complete_request(RGWRESTStreamRWRequest *req, string& etag, ceph::real_time *mtime, uint64_t *psize, map<string, string>& attrs);
 
index 277ff62c25660b48c30fb11553581fd8c4d268c3..7f44125135dc2cad12e39215cb3b945d61077287 100644 (file)
@@ -114,6 +114,15 @@ int RGWGetObj_ObjStore_S3Website::send_response_data_error()
   return RGWGetObj_ObjStore_S3::send_response_data_error();
 }
 
+int RGWGetObj_ObjStore_S3::get_params()
+{
+  // for multisite sync requests, only read the slo manifest itself, rather than
+  // all of the data from its parts. the parts will sync as separate objects
+  skip_manifest = s->info.args.exists(RGW_SYS_PARAM_PREFIX "sync-manifest");
+
+  return RGWGetObj_ObjStore::get_params();
+}
+
 int RGWGetObj_ObjStore_S3::send_response_data_error()
 {
   bufferlist bl;
index c89e7c329805d27d70da7468fcf0018c6c389a2b..89e67ff20da795bf02de2fdf9be68bb2c5d24ef8 100644 (file)
@@ -37,6 +37,7 @@ public:
   RGWGetObj_ObjStore_S3() {}
   ~RGWGetObj_ObjStore_S3() override {}
 
+  int get_params() override;
   int send_response_data_error() override;
   int send_response_data(bufferlist& bl, off_t ofs, off_t len) override;
   void set_custom_http_response(int http_ret) { custom_http_ret = http_ret; }