osd: Let the event loop run between PG peering calculations #197

Merged
vitalif merged 1 commits from koolkhel/vitastor:osd-peering-yield into master 2026-11-28 11:19:20 +03:00

1 Commits

Author SHA1 Message Date
66733b1369 osd: Let the event loop run between PG peering calculations
handle_peers() called ringloop->wakeup() after each calc_object_states(),
but wakeup() only makes ring_loop_t::loop() run the consumers again in the
same pass, before any completion is read. So an OSD that is primary for
several peering PGs calculated all of them back to back without answering
pings or renewing its etcd lease, and peers dropped it by osd_ping_timeout,
which started the peering again. Arm a 1 ms timer after each calculation
and start the next one when it fires: the loop then reads the completions
that came during the calculation, and the reads and sends they start get
time to finish, however many passes that takes.
2026-11-28 11:01:05 +03:00