]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: swift: fix: https://tracker.ceph.com/issues/37765 30135/head
authoran.groshev <an.groshev@tensor.ru>
Tue, 15 Jan 2019 12:57:34 +0000 (15:57 +0300)
committerNathan Cutler <ncutler@suse.com>
Sun, 8 Sep 2019 09:51:58 +0000 (11:51 +0200)
The meaning is as follows:
iterate_slo_parts() set end offset equal to the size of the segment,
but  RGWRados::iterate_obj args wait offset not size.

Signed-off-by: Andrey Groshev <an.groshev@tensor.ru>
(cherry picked from commit 9cbbd63776cfcbcd8011f77be15313ee8d9bc373)

Conflicts:
src/rgw/rgw_op.cc
- where master has "ldpp_dout(this, X)", mimic uses "ldout(s->cct, X)"

src/rgw/rgw_op.cc

index 5400a6247972d3a8fd0ee1788184dc0f7a30b09a..73e64c82aa2632eeafb3593df33f7b5baa94b897 100644 (file)
@@ -1379,7 +1379,7 @@ static int iterate_slo_parts(CephContext *cct,
     ent.meta.etag = part.etag;
 
     uint64_t cur_total_len = obj_ofs;
-    uint64_t start_ofs = 0, end_ofs = ent.meta.size;
+    uint64_t start_ofs = 0, end_ofs = ent.meta.size - 1;
 
     if (!found_start && cur_total_len + ent.meta.size > (uint64_t)ofs) {
       start_ofs = ofs - obj_ofs;
@@ -1389,7 +1389,7 @@ static int iterate_slo_parts(CephContext *cct,
     obj_ofs += ent.meta.size;
 
     if (!found_end && obj_ofs > (uint64_t)end) {
-      end_ofs = end - cur_total_len + 1;
+      end_ofs = end - cur_total_len;
       found_end = true;
     }
 
@@ -1398,6 +1398,12 @@ static int iterate_slo_parts(CephContext *cct,
 
     if (found_start) {
       if (cb) {
+        dout(20) << "iterate_slo_parts()"
+                          << " obj=" << part.obj_name
+                          << " start_ofs=" << start_ofs
+                          << " end_ofs=" << end_ofs
+                          << dendl;
+
        // SLO is a Swift thing, and Swift has no knowledge of S3 Policies.
         int r = cb(part.bucket, ent, part.bucket_acl,
                   (part.bucket_policy ?
@@ -1622,8 +1628,7 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl)
     part.obj_name = obj_name;
     part.size = entry.size_bytes;
     part.etag = entry.etag;
-    ldout(s->cct, 20) << "slo_part: ofs=" << ofs
-                      << " bucket=" << part.bucket
+    ldout(s->cct, 20) << "slo_part: bucket=" << part.bucket
                       << " obj=" << part.obj_name
                       << " size=" << part.size
                       << " etag=" << part.etag
@@ -1647,6 +1652,10 @@ int RGWGetObj::handle_slo_manifest(bufferlist& bl)
   }
 
   total_len = end - ofs + 1;
+  ldout(s->cct, 20) << "Requested: ofs=" << ofs
+                    << " end=" << end
+                    << " total=" << total_len
+                    << dendl;
 
   r = iterate_slo_parts(s->cct, store, ofs, end, slo_parts,
         get_obj_user_manifest_iterate_cb, (void *)this);