Merge pull request #61775 from yuvalif/wip-yuval-fix-loggin-obj-name

rgw/logging: flush command should print flushed log object name
This commit is contained in:
Yuval Lifshitz 2025-02-13 09:33:43 +02:00 committed by GitHub
commit 7a17c0b1fe
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 4 deletions

View 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;
}

View 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;
}
};