From: Yuval Lifshitz Date: Wed, 12 Feb 2025 15:33:55 +0000 (+0000) Subject: rgw/logging: flush command should print flushed log object name X-Git-Tag: v20.0.0~175^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F61775%2Fhead;p=ceph.git rgw/logging: flush command should print flushed log object name and not the next pending log object name Signed-off-by: Yuval Lifshitz --- diff --git a/src/rgw/radosgw-admin/radosgw-admin.cc b/src/rgw/radosgw-admin/radosgw-admin.cc index 2c14e61506ab3..45f4d7f16cdba 100644 --- a/src/rgw/radosgw-admin/radosgw-admin.cc +++ b/src/rgw/radosgw-admin/radosgw-admin.cc @@ -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; } diff --git a/src/rgw/rgw_rest_bucket_logging.cc b/src/rgw/rgw_rest_bucket_logging.cc index afd79b0a54855..505107d89679c 100644 --- a/src/rgw/rgw_rest_bucket_logging.cc +++ b/src/rgw/rgw_rest_bucket_logging.cc @@ -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; } };