-
Notifications
You must be signed in to change notification settings - Fork 554
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
[portsyncd]: Add producer for state database updates #336
Conversation
@jipanyanga please check this pull request. |
portsyncd/linksync.cpp
Outdated
FieldValueTuple tuple("state", "TRUE"); | ||
vector<FieldValueTuple> vector; | ||
vector.push_back(tuple); | ||
m_stateTableProducer.set(key, vector); |
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.
The problem I see here is that it will update stateDB port table with ":" separator which is inconsistent with configDB.
It is a general problem, due to table separator is changed to "|" from ":" by sonic-py-swsssdk, all other C++ swss-common library which has fixed ":" table separator won't be able to work with configDB.
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 should not use stateTableProducer, because we will not use stateTable Consumer to consume the data as it only supports one 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.
I'll use Table class for now.
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.
Could you update the change with latest Table class and use "|" for port state table in stateDB?
ProducerStateTable p(&db, APP_PORT_TABLE_NAME); | ||
DBConnector appl_db(APPL_DB, DBConnector::DEFAULT_UNIXSOCKET, 0); | ||
DBConnector state_db(STATE_DB, DBConnector::DEFAULT_UNIXSOCKET, 0); | ||
ProducerStateTable p(&appl_db, APP_PORT_TABLE_NAME); |
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.
use Table instead of producer state table.
Can you check the #344 to add similiar output for this PR? |
portsyncd/linksync.cpp
Outdated
m_vlanMemberTableProducer(appl_db, APP_VLAN_MEMBER_TABLE_NAME), | ||
m_portTable(appl_db, APP_PORT_TABLE_NAME), | ||
m_vlanMemberTable(appl_db, APP_VLAN_MEMBER_TABLE_NAME), | ||
m_stateTableProducer(state_db, "PORT_TABLE") |
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.
-> m_statePortTable(state_db, STATE_PORT_TABLE_NAME, CONFIGDB_TABLE_NAME_SEPARATOR)
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.
use table instead of producer table class for state db write.
810a4c6
to
97a72a8
Compare
- Add m_statePortTable to write to the state database once the ports are ready - Remove suffix Consumer in some variables since they are not 'consumers' Signed-off-by: Shu0T1an ChenG <[email protected]>
updated |
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 you show the output of the state db after this patch?
portsyncd/linksync.cpp
Outdated
@@ -195,6 +196,10 @@ void LinkSync::onMsg(int nlmsg_type, struct nl_object *obj) | |||
if (!g_init && g_portSet.find(key) != g_portSet.end()) | |||
{ | |||
g_portSet.erase(key); | |||
FieldValueTuple tuple("state", "TRUE"); |
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.
true - ok
|
…) to construct producer g_asicState (sonic-net#336) * create RedisPipeline obj by default constructor , which enabled redispipeline with parameter 128 * create producer g_asicState using redisPipeline instance with redispipeline enabled * with the changes in swss and swss-common, route performance improved by 200~300 routes/sec
Signed-off-by: Shu0T1an ChenG [email protected]