From 87990cc12109499a8b1c460c654de1ca965eae8c Mon Sep 17 00:00:00 2001 From: Casey Bodley Date: Mon, 11 Oct 2021 14:25:37 -0400 Subject: [PATCH] radosgw-admin: 'reshard list' doesn't log ENOENT errors ENOENT errors are expected, especially in fresh clusters, before we've written any entries to the reshard list shards. avoid logging these non-fatal ERROR messages: > -1 ERROR: failed to list reshard log entries, oid=reshard.0000000000 marker= (2) No such file or directory Fixes: https://tracker.ceph.com/issues/52873 Signed-off-by: Casey Bodley (cherry picked from commit 952c7c844acee5fe73e3f70737606b700b67238c) Conflicts: src/rgw/rgw_reshard.cc Cherry-pick notes: - Octopus using lderr vs ldpp_dout --- src/rgw/rgw_reshard.cc | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index b5733b240f325..eeac948c77840 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -875,17 +875,17 @@ int RGWReshard::list(int logshard_num, string& marker, uint32_t max, std::listgetRados()->reshard_pool_ctx, logshard_oid, marker, max, entries, is_truncated); - if (ret < 0) { - if (ret == -ENOENT) { - *is_truncated = false; - ret = 0; - } else { - lderr(store->ctx()) << "ERROR: failed to list reshard log entries, oid=" << logshard_oid << dendl; - if (ret == -EACCES) { - lderr(store->ctx()) << "access denied to pool " << store->svc()->zone->get_zone_params().reshard_pool - << ". Fix the pool access permissions of your client" << dendl; - } - } + if (ret == -ENOENT) { + // these shard objects aren't created until we actually write something to + // them, so treat ENOENT as a successful empty listing + *is_truncated = false; + ret = 0; + } else if (ret == -EACCES) { + lderr(store->ctx()) << "ERROR: access denied to pool " << store->svc()->zone->get_zone_params().reshard_pool + << ". Fix the pool access permissions of your client" << dendl; + } else if (ret < 0) { + lderr(store->ctx()) << "ERROR: failed to list reshard log entries, oid=" + << logshard_oid << " marker=" << marker << " " << cpp_strerror(ret) << dendl; } return ret; -- 2.39.5