]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: log errors during "bi list" 54196/head
authorJ. Eric Ivancich <ivancich@redhat.com>
Wed, 25 Oct 2023 21:02:12 +0000 (17:02 -0400)
committerJ. Eric Ivancich <ivancich@redhat.com>
Fri, 3 Nov 2023 20:35:11 +0000 (16:35 -0400)
Currently errors are displayed on STDERR but do not get into the
appropriate log. This duplicates the STDERR messages to the log.

Signed-off-by: J. Eric Ivancich <ivancich@redhat.com>
src/rgw/rgw_admin.cc

index cc7f5811c9efeee2a3341cbddb5e9a8c8637e34d..62fafdfcfb1bac758d45114c8b77b91d8b4ed218 100644 (file)
@@ -7670,7 +7670,8 @@ next:
 
     int ret = init_bucket(user.get(), tenant, bucket_name, bucket_id, &bucket);
     if (ret < 0) {
-      cerr << "ERROR: could not init bucket: " << cpp_strerror(-ret) << std::endl;
+      ldpp_dout(dpp(), 0) << "ERROR: could not init bucket: " << cpp_strerror(-ret) <<
+       dendl;
       return -ret;
     }
 
@@ -7690,13 +7691,13 @@ next:
     int i = (specified_shard_id ? shard_id : 0);
     for (; i < max_shards; i++) {
       ldpp_dout(dpp(), 20) << "INFO: " << __func__ << ": starting shard=" << i << dendl;
+      marker.clear();
 
       RGWRados::BucketShard bs(static_cast<rgw::sal::RadosStore*>(driver)->getRados());
       int ret = bs.init(dpp(), bucket->get_info(), index, i, null_yield);
-      marker.clear();
-
       if (ret < 0) {
-        cerr << "ERROR: bs.init(bucket=" << bucket << ", shard=" << i << "): " << cpp_strerror(-ret) << std::endl;
+       ldpp_dout(dpp(), 0) << "ERROR: bs.init(bucket=" << bucket << ", shard=" << i <<
+         "): " << cpp_strerror(-ret) << dendl;
         return -ret;
       }
 
@@ -7705,7 +7706,7 @@ next:
        // if object is specified, we use that as a filter to only retrieve some some entries
         ret = static_cast<rgw::sal::RadosStore*>(driver)->getRados()->bi_list(bs, object, marker, max_entries, &entries, &is_truncated, null_yield);
         if (ret < 0) {
-          cerr << "ERROR: bi_list(): " << cpp_strerror(-ret) << std::endl;
+          ldpp_dout(dpp(), 0) << "ERROR: bi_list(): " << cpp_strerror(-ret) << dendl;
           return -ret;
         }
        ldpp_dout(dpp(), 20) << "INFO: " << __func__ <<