Bug #47044
closedPG::_delete_some isn't optimal iterating objects
0%
Description
every step to build collection_list(https://github.com/ceph/ceph/blob/v14.2.11/src/osd/PG.cc#L7132) PG::_delete_some doesn't pass "next" object(from previos step) to function collection_list(https://github.com/ceph/ceph/blob/v14.2.11/src/osd/PG.cc#L7132) so every time _collection_list(https://github.com/ceph/ceph/blob/v14.2.11/src/os/bluestore/BlueStore.cc#L9822) iterating from root pg to next object and waste resource to iterate obsolete objects
It looks like for every iterate:
2020-08-14 12:49:33.825 7feecd488700 15 bluestore(/var/lib/ceph/osd/ceph-672) collection_list 17.236_head start GHMIN end GHMAX max 64
2020-08-14 12:49:33.825 7feecd488700 20 bluestore(/var/lib/ceph/osd/ceph-672) _collection_list range 0x7f7fffffffffffffed6c400000 to 0x7f7fffffffffffffed6c600000 and 0x7f80000000000000116c400000 to 0x7f80000000000000116c600000 start GHMIN
2020-08-14 12:49:33.825 7feecd488700 20 bluestore(/var/lib/ceph/osd/ceph-672) _collection_list pend 0x7f7fffffffffffffed6c600000
2020-08-14 12:49:33.825 7feecd488700 20 bluestore(/var/lib/ceph/osd/ceph-672) _collection_list key 0x7f7fffffffffffffff20002dfb216f73'dmap.163033!='0x0000000000000000ffffffffffffffff'o' >= GHMAX
2020-08-14 12:49:33.825 7feecd488700 20 bluestore(/var/lib/ceph/osd/ceph-672) _collection_list oid #17:6c400000::::head# end GHMAX
i mean that #17:6c400000::::head# == root pg and we start every time from this point
We have about 1M objects per pg so delete pg from osd after backfill takes much time and cpu+disk activity for iterating removed objects in previos steps