]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
osd/SnapMapper: 49428/head
authorGabriel BenHanokh <gbenhano@redhat.com>
Wed, 14 Dec 2022 12:55:19 +0000 (12:55 +0000)
committerGabriel BenHanokh <gbenhano@redhat.com>
Wed, 23 Aug 2023 13:47:45 +0000 (13:47 +0000)
commit690739e821557cb6b256cd35446083d2978d53b2
tree1e1edd3edd466868eee1078215473e59c2691c0e
parent9640080ae37c3490c337da23541655b886c2199a
osd/SnapMapper:
Maintain the prefix_itr between calls to SnapMapper::get_next_objects_to_trim() to prevent searching depleted prefixes.
We got 8 distinct hash prefixes used for searching objects owned by a given PG.
On each call to SnapMapper::get_next_objects_to_trim() we start from the first prefix even after all objects mapped to it were depleted.
This means that we will be searching for 1 non-existing prefix after the first prefix was depleted, 2 after the first two prefixes were depleted... and so on until we will search 7 non-existing prefixes after the first 7 prefixes were depleted.

This is a performance improvement PR only!
It maintains the existing behavior and does not try to fix/change any of the TRIM logic.
I added an extra step after the last object is trimmed doing a full scan of the DB and only if no object was found it will return ENOENT.
This should make the new code no-worse than existing code which returns ENOENT after a full scan found no object.
It should not impact performance in real life snaps as it should only happen once per-snap.

added snap-mapper tests to rados-test-suite
disabled osd_debug_trim_objects when running (SnapMapperTest, prefix_itr) to prevent asserts(as this code does illegal inserts into DELETED snaps)
Code beautifing

Signed-off-by: Gabriel BenHanokh <gbenhano@redhat.com>
qa/suites/rados/singleton-nomsgr/all/ceph-snapmapper.yaml [new file with mode: 0644]
qa/tasks/ceph.conf.template
src/common/options/osd.yaml.in
src/osd/SnapMapper.cc
src/osd/SnapMapper.h
src/test/CMakeLists.txt
src/test/test_snap_mapper.cc