]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
Merge pull request #67725 from mheler/wip-rgw-transition-recompress
authorAdam Emerson <aemerson@redhat.com>
Thu, 16 Jul 2026 20:52:07 +0000 (16:52 -0400)
committerGitHub <noreply@github.com>
Thu, 16 Jul 2026 20:52:07 +0000 (16:52 -0400)
rgw: compress/decompress objects during lifecycle transitions

Reviewed-by: Casey Bodley <cbodley@redhat.com>
1  2 
src/rgw/driver/rados/rgw_rados.cc
src/rgw/rgw_op.cc

index f1be19a176367b34f309f5824ef22948ff1b8b46,b473096d7bc6c41c3948b66c52a8aeb5174233b7..d4ee7e126d8b55221e86e3a839f5da058de1acf3
@@@ -5549,15 -5552,14 +5558,19 @@@ int RGWRados::copy_obj_data(RGWObjectCt
        ldpp_dout(dpp, 0) << "ERROR: failed to read compression info" << dendl;
        return ret;
      }
 -    // pass original size if compressed
 -    accounted_size = compressed ? cs_info.orig_size : ofs;
 +    // The bucket index accounted_size must be the object's logical (uncompressed)
 +    // size. When the destination is compressed we take it from the compression info.
 +    // Otherwise `ofs` is the number of RAW bytes read from the source: but if the source
 +    // itself is compressed, the ofs is the *compressed* size, not the logical
 +    // size. So, prefer the source's known logical size.
 +    accounted_size = compressed ? cs_info.orig_size
 +                                : (src_accounted_size ? src_accounted_size : ofs);
    }
  
+   if (dp_factory) {
+     accounted_size = dp_factory->get_accounted_size(accounted_size);
+   }
    const req_context rctx{dpp, y, nullptr};
    return aoproc.complete(accounted_size, etag, mtime, set_mtime, attrs,
                            rgw::cksum::no_cksum, delete_at,
@@@ -5658,10 -5826,9 +5837,10 @@@ int RGWRados::transition_obj(RGWObjectC
                        olh_epoch,
                        real_time(),
                        nullptr /* petag */,
-                       nullptr, /* dp_factory */
+                       dp_factory,
                        dpp,
                        y,
 +                      0, /* src_accounted_size: unknown here, keep ofs-based size */
                        log_op);
    if (ret < 0) {
      return ret;
Simple merge