From: Matt Benjamin Date: Fri, 24 Dec 2021 19:35:00 +0000 (-0500) Subject: rgwlc: warn on missing RGW_ATTR_LC X-Git-Tag: v17.2.0~30^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F45498%2Fhead;p=ceph.git rgwlc: warn on missing RGW_ATTR_LC This should not happen. If it does (e.g., due to damaged bucket_info), log the event to assist with debugging. Fixes: https://tracker.ceph.com/issues/53728 Signed-off-by: Matt Benjamin (cherry picked from commit ae1a75c09d11d8f0b626c781112c35de353c0c89) --- diff --git a/src/rgw/rgw_lc.cc b/src/rgw/rgw_lc.cc index ea1609bdb9d4..a819d6177780 100644 --- a/src/rgw/rgw_lc.cc +++ b/src/rgw/rgw_lc.cc @@ -1749,9 +1749,14 @@ int RGWLC::bucket_lc_process(string& shard_id, LCWorker* worker, return -ENOENT; } - map::iterator aiter = bucket->get_attrs().find(RGW_ATTR_LC); - if (aiter == bucket->get_attrs().end()) + map::iterator aiter + = bucket->get_attrs().find(RGW_ATTR_LC); + if (aiter == bucket->get_attrs().end()) { + ldpp_dout(this, 0) << "WARNING: bucket_attrs.find(RGW_ATTR_LC) failed for " + << bucket_name << " (terminates bucket_lc_process(...))" + << dendl; return 0; + } bufferlist::const_iterator iter{&aiter->second}; try {