From ccc2104fc157b0c210f7cd68f2c3e0555ce2fffe Mon Sep 17 00:00:00 2001 From: Cory Snyder Date: Fri, 22 Sep 2023 08:35:16 +0000 Subject: [PATCH] rgw: radosgw-admin bucket check should only print index entries with --check-objects flag Printing all index entries can be very time consuming for large buckets and the inability to switch this behavior off makes it cumbersome to use the command for fixing bucket stats. This was also preventing the command from outputting recalculated bucket stats when the --fix flag wasn't specified. Signed-off-by: Cory Snyder (cherry picked from commit 6b057fe55413c0eaf9959f006584cba6cc4c192a) Conflicts: src/rgw/driver/rados/rgw_bucket.cc Cherry-pick notes: - Conflicts due to rgw_bucket.cc moved to driver/rados directory on main --- src/rgw/rgw_bucket.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/rgw/rgw_bucket.cc b/src/rgw/rgw_bucket.cc index b720da6cab25a..1c582c12c3e9f 100644 --- a/src/rgw/rgw_bucket.cc +++ b/src/rgw/rgw_bucket.cc @@ -1428,9 +1428,11 @@ int RGWBucketAdminOp::check_index(rgw::sal::Store* store, RGWBucketAdminOpState& if (ret < 0) return ret; - ret = bucket.check_object_index(dpp, op_state, flusher, y); - if (ret < 0) - return ret; + if (op_state.will_check_objects()) { + ret = bucket.check_object_index(dpp, op_state, flusher, y); + if (ret < 0) + return ret; + } ret = bucket.check_index(dpp, op_state, existing_stats, calculated_stats); if (ret < 0) -- 2.39.5