Merge pull request #44408 from linuxbox2/wip-rgwlc-warn-attr

rgwlc:  warn on missing RGW_ATTR_LC

Reviewed-by: Daniel Gryniewicz <dang@redhat.com>
Reviewed-by: J. Eric Ivancich <ivancich@redhat.com>
This commit is contained in:
Casey Bodley 2022-01-31 17:49:35 -05:00 committed by GitHub
commit 36711cc49c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1749,9 +1749,14 @@ int RGWLC::bucket_lc_process(string& shard_id, LCWorker* worker,
return -ENOENT;
}
map<string, bufferlist>::iterator aiter = bucket->get_attrs().find(RGW_ATTR_LC);
if (aiter == bucket->get_attrs().end())
map<string, bufferlist>::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 {