WIP: [DNM] osd: run calc_object_states off the OSD thread #123

Draft
lei.xianqiang wants to merge 1 commits from lei.xianqiang/vitastor:calc_object_states_in_worker_threads into master

1 Commits

Author SHA1 Message Date
24d89be551 osd: run calc_object_states off the OSD thread
Sorting and walking every object version inside the OSD loop used to
stall OSD_OP_PING past osd_ping_timeout, so peers declared the OSD dead.

The calculation now runs on pg-calc threads. It only touches a scratch PG.
The main thread installs the result at the start of the next loop, before
 peering, and swaps the object maps so pointers into state_dict stay valid.

stop and repeer bump calc_gen. A job that has not entered
calc_object_states is dropped at once, so the new peering can LIST
without waiting out a stale sort. A job already inside the calculation
finishes, and its result is discarded. calc_inflight_gen names that
in-flight job, so its completion clears only its own calc_running and
cannot drop a calculation submitted later.

relock_pg does not dereference peering_state while the worker owns it.
Tests stay on the synchronous path because the mock ring loop does not
poll eventfd.
2026-11-17 16:43:12 +08:00