]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw: radosgw-admin bucket check should only print index entries with --check-objects... 52576/head
authorCory Snyder <csnyder@1111systems.com>
Fri, 22 Sep 2023 08:35:16 +0000 (08:35 +0000)
committerCory Snyder <csnyder@1111systems.com>
Fri, 22 Sep 2023 08:35:22 +0000 (08:35 +0000)
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 <csnyder@1111systems.com>
src/rgw/driver/rados/rgw_bucket.cc

index 707d64391e397c7462b6968fa01d005e1c5821cf..bddbfeced1e0d80949096ecf5263c4dbfeffac14 100644 (file)
@@ -1227,9 +1227,11 @@ int RGWBucketAdminOp::check_index(rgw::sal::Driver* driver, RGWBucketAdminOpStat
   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)