]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: data sync skips slo data when syncing the manifest object 14523/head
authorCasey Bodley <cbodley@redhat.com>
Wed, 8 Mar 2017 21:31:34 +0000 (16:31 -0500)
committerNathan Cutler <ncutler@suse.com>
Mon, 19 Jun 2017 20:50:22 +0000 (22:50 +0200)
Fixes: http://tracker.ceph.com/issues/19027
Signed-off-by: Casey Bodley <cbodley@redhat.com>
(cherry picked from commit 8b69847d7b3e92c70090d1dddf7cea5c44fb6b20)

Conflicts:
        src/rgw/rgw_rest_conn.cc (kraken is missing
            50c522ea89a756123bf74ab615138cf8478b2cee)
        src/rgw/rgw_rest_s3.h (omitted override because kraken is missing
            3b247475a2c35526c129535021adfa621ecb5327)

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 47f3790b3313f8bec57941863b15ab60059f5621..90f8879c5f90de52bf6229747ffa1ce76b6abe32 100644 (file)
@@ -6975,7 +6975,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;
   }
@@ -7154,7 +7154,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 a96c97819ba9ff05e37190c524ae04628b2d867b..c63281de195eceff7a623de9f85246ccd0623c83 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.get_instance().empty()) {
     const string& instance = obj.get_instance();
     params.push_back(param_pair_t("versionId", instance));
index f312efdaf43fdf3cf434adc4c2bef45a987e13c9..e7138625c8c59de1abb45ed49546a6ff53a73696 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 63b100e19a69d87a45fb94adde32fffbe7e98890..34e0cd3e192628644fa40bbda007d3b5400ecbcb 100644 (file)
@@ -112,6 +112,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 91c73613ab677113602ee24cf8c2c5d44f1e43b4..1bef7d7d21a87b8099f1423e5d0d77d48fe96915 100644 (file)
@@ -37,6 +37,7 @@ public:
   RGWGetObj_ObjStore_S3() {}
   ~RGWGetObj_ObjStore_S3() {}
 
+  int get_params();
   int send_response_data_error();
   int send_response_data(bufferlist& bl, off_t ofs, off_t len);
   void set_custom_http_response(int http_ret) { custom_http_ret = http_ret; }