Skip to content
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

ZMQ based state tables #715

Merged
merged 49 commits into from
May 12, 2023
Merged

Conversation

liuh-80
Copy link
Contributor

@liuh-80 liuh-80 commented Nov 22, 2022

Why I did it

Add ZMQ based ProducerStateTable and CustomerStateTable, which is 15 times faster than Redis based tables.
For transfer 10000 route config, ZMQ based tables take 120ms, Redis based tables take 1796ms.

How I did it

Add ZMQ based ProducerStateTable and CustomerStateTable.

How to verify it

Add new UT to cover ZmqProducerStateTable and ZmqCustomerStateTable.
Pass all UT and E2E test cases.

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

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Add ZMQ based ProducerStateTable and CustomerStateTable.

Link to config_db schema for YANG module changes

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

@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Nov 22, 2022

CLA Signed

The committers listed above are authorized under a signed CLA.

@liuh-80 liuh-80 force-pushed the dev/liuh/zmq_state_table branch from 2080d27 to 1426d70 Compare November 22, 2022 08:38
@liuh-80 liuh-80 force-pushed the dev/liuh/zmq_state_table branch from 1426d70 to 8b7499c Compare November 22, 2022 08:43
@liuh-80
Copy link
Contributor Author

liuh-80 commented Nov 28, 2022

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80 liuh-80 changed the title [POC] ZMQ based state tables ZMQ based state tables Dec 8, 2022
@liuh-80 liuh-80 marked this pull request as ready for review December 8, 2022 05:34
@liuh-80 liuh-80 requested a review from qiluo-msft December 8, 2022 05:34
common/zmqserver.cpp Outdated Show resolved Hide resolved
qiluo-msft
qiluo-msft previously approved these changes Apr 28, 2023
@liuh-80
Copy link
Contributor Author

liuh-80 commented Apr 28, 2023

@jiahua-wang
swss-common PR been blocked by this change in sairedis: sonic-net/sonic-sairedis#1230
That PR add new UT and require modify azure pipeline for UT, please also fix azure pipeline template in this repo.

@jiahua-wang
Copy link
Contributor

#778 should help passing the sairedis syncd unit test.

@liuh-80
Copy link
Contributor Author

liuh-80 commented May 8, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented May 8, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@liuh-80
Copy link
Contributor Author

liuh-80 commented May 8, 2023

PR blocked by docker API issue, fix PR here: #779

@liuh-80 liuh-80 force-pushed the dev/liuh/zmq_state_table branch from 38f071c to 1ae2ae6 Compare May 8, 2023 11:01
@liuh-80
Copy link
Contributor Author

liuh-80 commented May 11, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

else
{
// for other error, send failed immediately.
auto message = "zmq send failed, endpoint: " + m_endpoint + ",error: " + to_string(rc);
Copy link
Contributor

@qiluo-msft qiluo-msft May 11, 2023

Choose a reason for hiding this comment

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

error

Do you want add a blank before error? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

else if (zmq_err == ETERM)
{
m_connected = false;
auto message = "zmq connection break, endpoint: " + m_endpoint + ",error: " + to_string(rc);
Copy link
Contributor

@qiluo-msft qiluo-msft May 11, 2023

Choose a reason for hiding this comment

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

error

Do you want add a blank before error? #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

common/table.h Outdated
throw std::invalid_argument("Invalid table name separator");
}

static std::string gettableSeparator(int dbId)
Copy link
Contributor

@qiluo-msft qiluo-msft May 11, 2023

Choose a reason for hiding this comment

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

gettableSeparator

gettableSeparator -> getTableSeparator #Closed

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed
Also change ZmqConsumerTable inherite TableBase

@liuh-80 liuh-80 merged commit 5f41f0d into sonic-net:master May 12, 2023
@liuh-80 liuh-80 deleted the dev/liuh/zmq_state_table branch May 12, 2023 00:17
liuh-80 added a commit to sonic-net/sonic-swss that referenced this pull request May 12, 2023
…le. (#2562)

**What I did**
Improve Consumer interface to support ZMQ based Producer/Consumer table.

**Why I did it**
To improve route create performance, swsscommon lib will add ZMQ based Producer/Consumer table.
Because currently Consumer interface only support Redis based Producer/Consumer table, so improve this interface to support ZMQ based Producer/Consumer table.

ZMQ based Producer/Consumer table can find in this PR: sonic-net/sonic-swss-common#715

**How I verified it**
Pass all UT.

**Details if related**
liuh-80 added a commit to liuh-80/sonic-swss that referenced this pull request May 17, 2023
…le. (sonic-net#2562)

**What I did**
Improve Consumer interface to support ZMQ based Producer/Consumer table.

**Why I did it**
To improve route create performance, swsscommon lib will add ZMQ based Producer/Consumer table.
Because currently Consumer interface only support Redis based Producer/Consumer table, so improve this interface to support ZMQ based Producer/Consumer table.

ZMQ based Producer/Consumer table can find in this PR: sonic-net/sonic-swss-common#715

**How I verified it**
Pass all UT.

**Details if related**
liuh-80 added a commit to sonic-net/sonic-swss that referenced this pull request Jun 8, 2023
…le. (#2562) (#2778)

This is a cherry-pick PR for #2562

**What I did**
Improve Consumer interface to support ZMQ based Producer/Consumer table.

**Why I did it**
To improve route create performance, swsscommon lib will add ZMQ based Producer/Consumer table. Because currently Consumer interface only support Redis based Producer/Consumer table, so improve this interface to support ZMQ based Producer/Consumer table.

ZMQ based Producer/Consumer table can find in this PR: sonic-net/sonic-swss-common#715

**How I verified it**
Pass all UT.

**Details if related**

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

**What I did**

**Why I did it**

**How I verified it**

**Details if related**
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