osd: Yield between peering calcs started from continue_pg() too #200
Reference in New Issue
Block a user
No description provided.
Delete Branch "koolkhel/vitastor:osd-peering-yield-repeer"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description
Follow-up to #197. Only
handle_peers()arms the 1 ms yield timer, butcontinue_pg_peering()also runs fromcontinue_pg()(src/osd/osd_peering.cpp:840): after a lock reply, and throughreport_pg_state()->relock_pg()(src/osd/osd_peering.cpp:813) every time a PG starts peering.start_pg_peering()keeps the lists of the peers that stay in the PG (src/osd/osd_peering.cpp:297), so a re-peered PG that was waiting for its calc has all its lists at once and is calculated right insidestart_pg_peering().So when the /osd/state of a connected peer disappears,
on_change_osd_state_hook()->repeer_pgs()calculates every PG that has that peer and waits for its calc, back to back in one pass. With #197 a PG can wait for its calc for several calcs of other PGs, so the window is seconds long on an OSD that is primary for many large PGs.The change: arm the timer in
continue_pg_peering()right after the calc, and skip the calc while the timer is armed.handle_peers()takes the PG when the timer fires (OSD_PEERING_PGSstays set while a PG is peering).Independent of #199, which sends the queued replies before a calc in
osd_t::loop(): different code, no conflict.Found: by reading the code, then reproduced in osd_test; not seen in a run.
Tested:
repeer_pgs()for the peer must leave the second peering until the timer fires. It fails on master: the re-peer calculates it at once.Contributor Name
Yury Luneff (MIND Software LLC, https://mindsw.io)
CLA