Skip to content

Commit 7a17c0b

Browse files
authored
Merge pull request ceph#61775 from yuvalif/wip-yuval-fix-loggin-obj-name
rgw/logging: flush command should print flushed log object name
2 parents 5c1b470 + 1e7663d commit 7a17c0b

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

src/rgw/radosgw-admin/radosgw-admin.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7741,13 +7741,14 @@ int main(int argc, const char **argv)
77417741
cerr << "ERROR: failed to get pending logging object name from target bucket '" << configuration.target_bucket << "'" << std::endl;
77427742
return -ret;
77437743
}
7744+
const auto old_obj = obj_name;
77447745
ret = rgw::bucketlogging::rollover_logging_object(configuration, target_bucket, obj_name, dpp(), null_yield, true, &objv_tracker);
77457746
if (ret < 0) {
7746-
cerr << "ERROR: failed to flush pending logging object '" << obj_name
7747+
cerr << "ERROR: failed to flush pending logging object '" << old_obj
77477748
<< "' to target bucket '" << configuration.target_bucket << "'" << std::endl;
77487749
return -ret;
77497750
}
7750-
cout << "flushed pending logging object '" << obj_name
7751+
cout << "flushed pending logging object '" << old_obj
77517752
<< "' to target bucket '" << configuration.target_bucket << "'" << std::endl;
77527753
return 0;
77537754
}

src/rgw/rgw_rest_bucket_logging.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,13 +344,14 @@ class RGWPostBucketLoggingOp : public RGWDefaultResponseOp {
344344
ldpp_dout(this, 1) << "ERROR: failed to get pending logging object name from target bucket '" << target_bucket_id << "'" << dendl;
345345
return;
346346
}
347+
const auto old_obj = obj_name;
347348
op_ret = rgw::bucketlogging::rollover_logging_object(configuration, target_bucket, obj_name, this, null_yield, true, &objv_tracker);
348349
if (op_ret < 0) {
349-
ldpp_dout(this, 1) << "ERROR: failed to flush pending logging object '" << obj_name
350+
ldpp_dout(this, 1) << "ERROR: failed to flush pending logging object '" << old_obj
350351
<< "' to target bucket '" << target_bucket_id << "'" << dendl;
351352
return;
352353
}
353-
ldpp_dout(this, 20) << "INFO: flushed pending logging object '" << obj_name
354+
ldpp_dout(this, 20) << "INFO: flushed pending logging object '" << old_obj
354355
<< "' to target bucket '" << configuration.target_bucket << "'" << dendl;
355356
}
356357
};

0 commit comments

Comments
 (0)