]> git-server-git.apps.pok.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>
Mon, 11 Apr 2022 07:25:08 +0000 (09:25 +0200)
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>
(cherry picked from commit dd83913606a870c08f9602d3eebac9444d7a0cc9)

src/rgw/rgw_reshard.cc

index 5eb038a164ccb4961d0630257cc40aa1fb2cfdd0..bf2248fc7f90bc1782afd8b3e25c575d70820412 100644 (file)
@@ -626,6 +626,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)) {