]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commit
osd/PGBackend::be_scan_list: only call stat, getattrs once per object
authorSamuel Just <sjust@redhat.com>
Thu, 18 Apr 2024 22:15:25 +0000 (15:15 -0700)
committerRadoslaw Zarzynski <rzarzyns@redhat.com>
Fri, 19 Apr 2024 19:00:32 +0000 (19:00 +0000)
commitf087679af5af13de4e282f3f01eae6dab6684ad4
treea5e5cac1693bc601c612925bb10406de22d18220
parente02d68a84525e0fa855f080a47dd96b350c21c42
osd/PGBackend::be_scan_list: only call stat, getattrs once per object

We call back into be_scan_list repeatedly for the same object in deep
scrub if the object is too large/has too many omap entries to be done
in a single call.  This causes us to wastefully call
ObjectStore::getattrs and stat multiple times.

This has been a long standing, but mostly harmless bug (aside from the
extra metadata traffic).  However, 1a4d3f018, between reef and squid,
switched ScrubMap::object::attrs to a map<string, bufferlist> from a
map<string, bufferptr>.  This should have been harmless, except that
the ObjectStore::getattrs overload for that type uses

      aset[i->first].append(i->second);

rather than

      aset.emplace(i.first.c_str(), i.second);

to populate the map.  Combined with this bug, that means that if we
need 7 calls into be_scan_list to deep scrub an object, we'll end up
with attributes concatenated 7 times each.  This didn't cause visible
problems with squid/main testing since all of the replicas would end
up doing the same thing and they'd still decode ok, but it did become
visible during reef->squid upgrade testing as the older osds sent
maps with the correct contents.

The next commit will fix ObjectStore::getattrs to clear the map.

Fixes: https://tracker.ceph.com/issues/65185
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 5671e8555eddc622a6edb926e67dadce79e6add5)
src/osd/PGBackend.cc
src/osd/osd_types.h