Skip to content

Add Orchagent ZMQ table feature flag: orch_dash_zmq_enabled and orch_route_zmq_enabled. #22451

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

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Apr 27, 2025

Add Orchagent ZMQ table feature flag: orch_dash_zmq_enabled and orch_route_zmq_enabled

Why I did it

On current image, orchagent only enable ZMQ on Dash tables, so use -q option to control the ZMQ feature is enough.

However, we plan to improve route performance by enable ZMQ between fpmsyncd and orchagent. sonic-net/SONiC#1659

Then there will be 2 features on orchagent share same ZMQ address, so using -q to control the Dash ZMQ feature is not enough.

For Dash, we plan to migrate to enable/disable with the 'orch_dash_zmq_enabled' feature flag. There will be another PR in orchagent to make Dash enable/disable ZMQ with this flag.

And for improve route performance by enable ZMQ between fpmsyncd and orchagent, it will be controlled by the 'orch_route_zmq_enabled' flag.

Work item tracking
  • Microsoft ADO (number only):32582830

How I did it

Add orch_dash_zmq_enabled and orch_route_zmq_enabled field to DEVICE_METADATA table in config_db.

orch_dash_zmq_enabled:
Control enable/disable ZMQ on Dash feature.

orch_route_zmq_enabled:
Control enable/disable ZMQ between fpmsyncd and orchagent for improve route performance.

How to verify it

Pass all test case.

Manually verified orch_zmq_tables.conf can generate correctly according to CONFIG_DB

admin@vlab-01:$ sonic-db-cli CONFIG_DB hset "DEVICE_METADATA|localhost" "orch_route_zmq_enabled" "true"
1
admin@vlab-01:
$ sonic-db-cli CONFIG_DB hset "DEVICE_METADATA|localhost" "orch_dash_zmq_enabled" "true"
1
admin@vlab-01:$ sudo config save -y
Running command: /usr/local/bin/sonic-cfggen -d --print-data > /etc/sonic/config_db.json
admin@vlab-01:
$ sudo config reload -y
Acquired lock on /etc/sonic/reload.lock
Disabling container and routeCheck monitoring ...
Stopping SONiC target ...
Running command: /usr/local/bin/sonic-cfggen -j /etc/sonic/init_cfg.json -j /etc/sonic/config_db.json --write-to-db
Running command: /usr/local/bin/db_migrator.py -o migrate
Running command: /usr/local/bin/sonic-cfggen -d -y /etc/sonic/sonic_version.yml -t /usr/share/sonic/templates/sonic-environment.j2,/etc/sonic/sonic-environment
Restarting SONiC target ...
Enabling container and routeCheck monitoring ...
Reloading Monit configuration ...
Reinitializing monit daemon
Released lock on /etc/sonic/reload.lock
admin@vlab-01:~$ docker exec -it swss bash
root@sonic:/# cat /etc/swss/orch_zmq_tables.conf
DASH_VNET_TABLE
DASH_QOS_TABLE
DASH_ENI_TABLE
DASH_ACL_IN_TABLE
DASH_ACL_OUT_TABLE
DASH_ACL_GROUP_TABLE
DASH_ACL_RULE_TABLE
DASH_HA_SET_TABLE
DASH_HA_SCOPE_TABLE
DASH_PREFIX_TAG_TABLE
DASH_ROUTING_TYPE_TABLE
DASH_APPLIANCE_TABLE
DASH_ROUTE_TABLE
DASH_ROUTE_RULE_TABLE
DASH_VNET_MAPPING_TABLE
DASH_ENI_ROUTE_TABLE
DASH_ROUTE_GROUP_TABLE
DASH_TUNNEL_TABLE
DASH_PA_VALIDATION_TABLE
DASH_METER_POLICY_TABLE
DASH_METER_RULE_TABLE
DASH_ROUTING_APPLIANCE_TABLE
DASH_ENI_FORWARD_TABLE
ROUTE_TABLE
LABEL_ROUTE_TABLE

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

Description for the changelog

Add Orchagent ZMQ table feature flag: orch_dash_zmq_enabled and orch_route_zmq_enabled

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 marked this pull request as ready for review April 27, 2025 14:57
@liuh-80 liuh-80 requested a review from qiluo-msft as a code owner April 27, 2025 14:57
@liuh-80 liuh-80 requested review from xumia and lguohan as code owners April 28, 2025 03:03
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 28, 2025

/azpw ms_conflict

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 29, 2025

/azpw run ms_conflict

@mssonicbld
Copy link
Collaborator

/AzurePipelines run ms_conflict

Copy link

No pipelines are associated with this pull request.

@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 29, 2025

/azpw ms_conflict

@qiluo-msft qiluo-msft requested a review from prsunny April 29, 2025 20:22
qiluo-msft
qiluo-msft previously approved these changes Apr 29, 2025
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 30, 2025

/azpw ms_conflict

Copy link
Contributor

@prsunny prsunny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm, @prabhataravind for viz

Copy link
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can potentially cause issues because we are not planning to have zmq enabled for non-dash tables in orchagent. If the throughput b/w fpmsyncd and orchagent is very high and orchangent<->syncd interface can't keep up with it, we will have issues. @prsunny @liuh-80

@qiluo-msft qiluo-msft requested review from rlhui and abdosi April 30, 2025 21:28
@qiluo-msft
Copy link
Collaborator

This feature is configurable by "orch_route_zmq_enabled" in ConfigDB.

@@ -300,6 +300,18 @@ module sonic-device_metadata {
description "Set source of anchor route";
}

leaf orch_dash_zmq_enabled {
type boolean;
description "Enable ZMQ feature on APPL_DB DASH tables.";
Copy link
Contributor

@prabhataravind prabhataravind Apr 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Now that you have a dedicated flag for dash orchs to use zmq, can we deprecate the current '-q' option with zmq_server_address that is currently passed to orchagent in smartswitch to enable zmq b/w gnmi and orchagent and use this instead? Why not have a consistent way to enable zmq b/w orchagent and all other components like gnmi, fpmsyncd etc..?

Ref: #16661

Copy link
Contributor Author

@liuh-80 liuh-80 May 1, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

On current image, orchagent only enable ZMQ on Dash tables, so use -q option to control the ZMQ feature is enough.

However, we plan to improve route performance by enable ZMQ between fpmsyncd and orchagent.

Then there will be 2 features on orchagent share same ZMQ address, so using -q to control the Dash ZMQ feature is not enough.

For Dash, we plan to migrate to enable/disable with the 'orch_dash_zmq_enabled' feature flag. There will be another PR in orchagent to make Dash enable/disable ZMQ with this flag.

And for improve route performance by enable ZMQ between fpmsyncd and orchagent, it will be controlled by the 'orch_route_zmq_enabled' flag.

But the -q option will keep, because the ZMQ address is generated according to the mgmt_ip and eth0-midplane interface status.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

okay, please link all relevant zmq PRs together for convenience when you get a chance.

@prabhataravind
Copy link
Contributor

prabhataravind commented Apr 30, 2025

This feature is configurable by "orch_route_zmq_enabled" in ConfigDB.

@qiluo-msft will the def

This feature is configurable by "orch_route_zmq_enabled" in ConfigDB.

@qiluo-msft I see the yang model specifies a default value of false for these. As long as config_db will have this disabled by default, it should be ok but it will be useful to understand what is the end-end gain if orchagent<->syncd interface is still using redis.

@liuh-80 liuh-80 changed the title Add Orchagent ZMQ table feature flag. Add Orchagent ZMQ table feature flag: orch_dash_zmq_enabled and orch_route_zmq_enabled. May 1, 2025
Copy link
Contributor

@prabhataravind prabhataravind left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed offline

prsunny pushed a commit to sonic-net/sonic-swss that referenced this pull request May 2, 2025
* Improve swss to support ZMQ

Why I did it
swssconfig does not support ZMQ

How I did it
Improve swss to support ZMQ
swssconfig will load orchagent ZMQ table list from CONFIG_DB, and create ZMQ channel according to the config:
sonic-net/sonic-buildimage#22451
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants