osd: Merge object lists on peering instead of copying and sorting them #180

Open
koolkhel wants to merge 3 commits from koolkhel/vitastor:osd-peering-merge into master

3 Commits

Author SHA1 Message Date
6202e721b5 osd: Test peering with list counts beyond the list
A peer may report stable and tombstone counts above the number of
entries it sent; check that the merge clamps them and does not read
past the buffer. Also assert the rollback target in the large XOR
test: the OSD that rolls back holds no older version of its part.
2026-11-25 20:40:06 +03:00
2cf7baf4fb osd: Feed the peering merge test one LIST-shaped buffer per OSD
Put the stable, unstable and tombstone segments of an OSD into one
buffer, as LIST returns them, so a sort running past its segment is
caught. Set pg_data_size in the large XOR test, so it checks that the
unstable version on one OSD is rolled back.
2026-11-25 03:08:32 +03:00
351fe97ae3 osd: Merge object lists on peering instead of copying and sorting them
calc_object_states() copied every listed object version into one array
and sorted it, which blocks the OSD event loop for seconds when a PG
holds millions of object versions. Store v1 lists consist of a few
sorted runs, so merge the runs with a heap and check objects one at a
time. A list that is not made of a few sorted runs (the new store lists
objects unordered) is sorted on its own first. The result is the same
as with the full sort.
2026-11-24 23:08:21 +03:00