]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
rgw/logging: flush command should print flushed log object name
authorYuval Lifshitz <ylifshit@ibm.com>
Wed, 12 Feb 2025 15:33:55 +0000 (15:33 +0000)
committerYuval Lifshitz <ylifshit@ibm.com>
Wed, 12 Feb 2025 15:33:55 +0000 (15:33 +0000)
and not the next pending log object name

Signed-off-by: Yuval Lifshitz <ylifshit@ibm.com>
src/rgw/radosgw-admin/radosgw-admin.cc
src/rgw/rgw_rest_bucket_logging.cc

index 2c14e61506ab3d620034e8cc7bba71874a4d13b7..45f4d7f16cdba078a236b52bbf9694a33e84e2db 100644 (file)
@@ -7741,13 +7741,14 @@ int main(int argc, const char **argv)
       cerr << "ERROR: failed to get pending logging object name from target bucket '" << configuration.target_bucket << "'" << std::endl;
       return -ret;
     }
+    const auto old_obj = obj_name;
     ret = rgw::bucketlogging::rollover_logging_object(configuration, target_bucket, obj_name, dpp(), null_yield, true, &objv_tracker);
     if (ret < 0) {
-      cerr << "ERROR: failed to flush pending logging object '" << obj_name
+      cerr << "ERROR: failed to flush pending logging object '" << old_obj
         << "' to target bucket '" << configuration.target_bucket << "'" << std::endl;
       return -ret;
     }
-    cout << "flushed pending logging object '" << obj_name
+    cout << "flushed pending logging object '" << old_obj
       << "' to target bucket '" << configuration.target_bucket << "'" << std::endl;
     return 0;
   }
index afd79b0a5485578e8e5d2f9bec56d76bea7f6fc3..505107d89679c85ded58139cc74e4e22b81718ad 100644 (file)
@@ -344,13 +344,14 @@ class RGWPostBucketLoggingOp : public RGWDefaultResponseOp {
       ldpp_dout(this, 1) << "ERROR: failed to get pending logging object name from target bucket '" << target_bucket_id << "'" << dendl;
       return;
     }
+    const auto old_obj = obj_name;
     op_ret = rgw::bucketlogging::rollover_logging_object(configuration, target_bucket, obj_name, this, null_yield, true, &objv_tracker);
     if (op_ret < 0) {
-      ldpp_dout(this, 1) << "ERROR: failed to flush pending logging object '" << obj_name
+      ldpp_dout(this, 1) << "ERROR: failed to flush pending logging object '" << old_obj
                << "' to target bucket '" << target_bucket_id << "'" << dendl;
       return;
     }
-    ldpp_dout(this, 20) << "INFO: flushed pending logging object '" << obj_name
+    ldpp_dout(this, 20) << "INFO: flushed pending logging object '" << old_obj
                 << "' to target bucket '" << configuration.target_bucket << "'" << dendl;
   }
 };