[orchagent] HLD: Improve Resiliency of Orchagent Route Programming#2328
[orchagent] HLD: Improve Resiliency of Orchagent Route Programming#2328venkit-nexthop wants to merge 2 commits into
Conversation
|
/azp run |
|
No pipelines are associated with this pull request. |
53b42db to
f06d9a9
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
f06d9a9 to
09b589f
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
Add a high-level design document covering the orchagent route programming redesign to improve resiliency. The redesign eliminates non-coalescing intermediate queues by updating m_toSync directly from mqPollThread, splits drain() into three independently schedulable stages (toBulkTask, flushTask, responseHandlingTask) with yield/resume semantics and bounded time quanta, and makes the route state publish asynchronous. Per-task instrumentation in orchdaemon and corresponding show/clear CLIs are also covered. Tracked under sonic-net/sonic-buildimage#27098. Signed-off-by: Venkit Kasiviswanathan <venkit@nexthop.ai>
09b589f to
65cf377
Compare
|
/azp run |
|
No pipelines are associated with this pull request. |
HLD ReviewTL;DR: Solid HLD that addresses a real pain point — orchagent's route programming path starving other orch agents under churn. The design is well-structured and the incremental rollout approach is pragmatic. A few concerns below. Strengths
Concerns / Questions
Minor nits
Overall this is a well-thought-out HLD for a meaningful improvement. The main gap is more specifics on the concurrency model (lock strategy, quantum values, starvation prevention). Would approve with those addressed. |
|
**On Qi's +1 to Qi's suggestion of a coalescing intermediate rather than locking Result — two things the goal hinges on:
Architecture: it keeps On "won't the later yield/resume split shorten the lock anyway?" — it reduces the duration, but the intermediate is what makes that split correct: you can't hold a lock across a yield, so a resumed |
|
@venkit-nexthop, could you check and address comments.. JFYI, I will be tracking this PR set actively and will try to help coordinate reviews/discussions/merges as needed. |
I am working on this. |
Match the design implemented in sonic-swss-common#1187 and sonic-swss#4564: the mqPollThread ingress callback coalesces tuples into a plain staging map (m_ingress) under m_toSyncMutex rather than merging into m_toSync directly. ZmqRouteConsumer::execute() merges the staged tuples into m_toSync under the lock and then runs drain() lock-free. Revise sections 4, 6.3, 7.2, 7.9, 12, and 13.1, bump the revision table, and update the new-design diagram. Signed-off-by: Venkit Kasiviswanathan <venkit@nexthop.ai>
|
/azp run |
|
No pipelines are associated with this pull request. |
deepak-singhal0408
left a comment
There was a problem hiding this comment.
Thanks for addressing the feedbacks. Overall Design LGTM.
Summary
doc/orchagent/describing a redesign of the orchagent route programming hot path.m_toSyncdirectly frommqPollThread, splitsdrain()into three independently schedulable stages (toBulkTask,flushTask,responseHandlingTask) with yield/resume semantics and bounded time quanta, and makes the route state publish asynchronous.show orchagent tasks/sonic-clear orchagent tasksinstrumentation.doc/orchagent/images/orchagent_route_redesign/(no inline base64).Why
Tracked under sonic-net/sonic-buildimage#27098: the current serial
pops()/addToSync()/drain()flow in the orchagent main thread lets ZMQ buffers and intermediate non-coalescing queues back up under churn and starves other orch agents of CPU.Test plan
images/orchagent_route_redesign/*.pnglinks.