From: Dan van der Ster Date: Tue, 8 Mar 2022 20:11:46 +0000 (+0100) Subject: rgw_reshard: drop olh entries with empty name X-Git-Tag: v17.2.1~50^2~1 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=4b0ec70048fa33faf9414e67fca883701b93d744;p=ceph.git rgw_reshard: drop olh entries with empty name 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 (cherry picked from commit dd83913606a870c08f9602d3eebac9444d7a0cc9) --- diff --git a/src/rgw/rgw_reshard.cc b/src/rgw/rgw_reshard.cc index f104b488921c..532dad7b47fd 100644 --- a/src/rgw/rgw_reshard.cc +++ b/src/rgw/rgw_reshard.cc @@ -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)) {