]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: trim bilog: send bucket param instead of source-bucket param
authorYehuda Sadeh <yehuda@redhat.com>
Thu, 23 Jan 2020 22:33:16 +0000 (14:33 -0800)
committerYehuda Sadeh <yehuda@redhat.com>
Tue, 28 Jan 2020 18:20:40 +0000 (10:20 -0800)
For backward compatibility, so that older rgws could handle it appropriately.

Signed-off-by: Yehuda Sadeh <yehuda@redhat.com>
src/rgw/rgw_rest_log.cc
src/rgw/rgw_trim_bilog.cc

index 735e652014a0cad3fa2c00e3c547d6d54517e891..c0e0aa6b86d0cc8cb843a5b0b4bb9cf3ad41cff3 100644 (file)
@@ -866,7 +866,8 @@ void RGWOp_BILog_Status::execute()
 
   rgw_bucket source_bucket;
 
-  if (source_key.empty()) {
+  if (source_key.empty() ||
+      source_key == key) {
     source_bucket = info.bucket;
   } else {
     http_ret = rgw_bucket_parse_bucket_key(s->cct, source_key, &source_bucket, nullptr);
index abfba41331b0688d3438e2a9c7b250ad8c4a26ab..8ccc6d54743876817d16e9fe4eeaf6d64a60e8a1 100644 (file)
@@ -500,7 +500,8 @@ int BucketTrimInstanceCR::operate()
           { "type", "bucket-index" },
           { "status", nullptr },
           { "options", "merge" },
-          { "source-bucket", bucket_instance.c_str() },
+          { "bucket", bucket_instance.c_str() }, /* equal to source-bucket when `options==merge` and source-bucket
+                                                    param is not provided */
           { "source-zone", zone_id.c_str() },
           { nullptr, nullptr }
         };