]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
rgw_reshard: drop olh entries with empty name
authorDan van der Ster <daniel.vanderster@cern.ch>
Tue, 8 Mar 2022 20:11:46 +0000 (21:11 +0100)
committerDan van der Ster <daniel.vanderster@cern.ch>
Thu, 10 Mar 2022 11:39:37 +0000 (12:39 +0100)
Due to a previous bug bucket indices can have olh entries with
an empty name. During reshard these are all mapped to shard 0,
easily triggering warnings about too many omap entries.

Skip these entries during reshard, thereby cleaning the bucket
of these leftover bogus entries.

Fixes: https://tracker.ceph.com/issues/54500
Related-to: https://tracker.ceph.com/issues/46456
Signed-off-by: Dan van der Ster <daniel.vanderster@cern.ch>
src/rgw/rgw_reshard.cc

index f104b488921c104203eeac33eafa23027e0248e5..532dad7b47fd19c72875e877b43ed6ee3d39329d 100644 (file)
@@ -628,6 +628,13 @@ int RGWBucketReshard::do_reshard(int num_shards,
        rgw_bucket_category_stats stats;
        bool account = entry.get_info(&cls_key, &category, &stats);
        rgw_obj_key key(cls_key);
+        if (entry.type == BIIndexType::OLH && key.empty()) {
+         // bogus entry created by https://tracker.ceph.com/issues/46456
+         // to fix, skip so it doesn't get include in the new bucket instance
+         total_entries--;
+         ldpp_dout(dpp, 10) << "Dropping entry with empty name, idx=" << marker << dendl;
+         continue;
+       }
        rgw_obj obj(new_bucket_info.bucket, key);
        RGWMPObj mp;
        if (key.ns == RGW_OBJ_NS_MULTIPART && mp.from_meta(key.name)) {