osd: Send queued replies before a peering calculation #199

Merged
vitalif merged 3 commits from koolkhel/vitastor:osd-reply-before-peering into master 2026-11-29 14:13:14 +03:00

3 Commits

Author SHA1 Message Date
046bba7a8f osd: Send queued replies right before each peering calc
continue_pg() calculates a re-peered PG, which keeps the lists of the
peers that stay, from a completion callback (a lock reply, an etcd
event), so loop() reached its early flush only after the calc, and the
replies queued earlier in that pass waited for it. Send them in
continue_pg_peering() right before the calc instead: that covers both
paths and needs no peering_state check in loop().
2026-11-28 18:19:34 +03:00
0571c14e18 osd: Send replies early only while PGs are peering
The early send_replies() and submit() in osd_t::loop() cost a second
io_uring_enter in every busy pass that also queues new receives. Do
them only while OSD_PEERING_PGS is set: handle_peers() can start a calc
only then.
2026-11-28 16:22:12 +03:00
ad91c6ac59 osd: Send queued replies before a peering calculation
osd_t::loop() ran handle_peers() before send_replies(). When the peering
yield timer fired in a pass that also handled incoming requests, their
replies were queued in that pass but sent only after the next PG
calculation, so under load a ping waited for two calculations instead
of one. Send the queued replies and submit before handle_peers().
2026-11-28 11:42:54 +03:00