-
Notifications
You must be signed in to change notification settings - Fork 520
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[dash] Improve dash orchagent ZMQ code. #2836
Conversation
orchagent/dash/dashorchbase.h
Outdated
void drain() override; | ||
}; | ||
|
||
class DashOrchBase : public Orch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this be named as "ZmqOrchBase" for other non-dash orchs to use it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently this class is only designed for dash orch. because only dash orch using ZMQ to receive data from GNMI.
The reason I rename this from ZmqOrch to DashOrchBase because there are comments that create consumer/zmqconsumer based on parameter is wried for ZmqOrch, because the behavior is only required by dash so I rename this class.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We are looking at this to find potential performance improvement in our use case as well.
Wouldn't it be nice to make it usable to other orchs (and eventually migrate other orchs to use zmq)?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, I think eventually we will support other orch.
Migrate ZMQ also need client side change, currently the Dash orch only have gnmi as client. so fir the first step we plan only for Dash orch.
And if other Orch want ZMQ support, we can do it in another PR with more improvement, for example create a consumer builder interface for ZmqConsumer and redis based Consumer, and change all Orch ctor code to accept a build as parameter.
However that's need change all orch code, so it's better to put in a seprate PR.
orchagent/dash/dashorchbase.h
Outdated
void drain() override; | ||
}; | ||
|
||
class DashOrchBase : public Orch |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed, rename back to ZmqOrch
@liuh-80 , can you please fix the description of PR to better align with new code? Also, "why" section. Link to any HLD if there is one. |
Fixed, Description updated also add HLD link. |
orchagent/zmqorch.cpp
Outdated
void ZmqConsumer::drain() | ||
{ | ||
if (!m_toSync.empty()) | ||
(static_cast<ZmqOrch*>(m_orch))->doTask(static_cast<ZmqConsumer&>(*this)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
*this
is already in this class ZmqConsumer
. Is this casting really needed?
#Closed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
orchagent/zmqorch.cpp
Outdated
void ZmqOrch::doTask(Consumer &consumer) | ||
{ | ||
// When ZMQ disabled, forward data from Consumer | ||
doTask(static_cast<ConsumerBase &>(consumer)); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed
#include <orch.h> | ||
#include "zmqserver.h" | ||
|
||
class ZmqConsumer : public ConsumerBase { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This does not have all the consumer methods. How does warm boot work?
Looks like the current codes just cast the executor to be Consumer in the warmboot logic. It won't work for ZmqConsumer.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I confirmed that currently the Dash no plan for warm-reboot support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have two PRs:
#2857
sonic-net/sonic-swss-common#803
Could you take a look at them please?
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code. **What I did** Move ZmqOrch related code to new files. Remove unused code. Change ZmqOrch::doTask() to use ConsumerBase as parameter. Fix orchagent start parameter parse bug. Fix dash orch can't receive data when ZMQ disabled issue. **Why I did it** Improve dash orchagent code. HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1 **How I verified it** Pass all UT. **Details if related**
Improve dash orchagent code.
What I did
Move ZmqOrch related code to new files.
Remove unused code.
Change ZmqOrch::doTask() to use ConsumerBase as parameter.
Fix orchagent start parameter parse bug.
Fix dash orch can't receive data when ZMQ disabled issue.
Why I did it
Improve dash orchagent code.
HLD: https://github.com/sonic-net/SONiC/blob/master/doc/sonic-swss-common/ZMQ%20producer-consumer%20state%20table%20design.md?plain=1
How I verified it
Pass all UT.
Details if related