[portsyncd]: Add producer for state database updates#336
[portsyncd]: Add producer for state database updates#336lguohan merged 1 commit intosonic-net:masterfrom
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.
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.
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.
I'll use Table class for now.
There was a problem hiding this comment.
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.
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.
-> m_statePortTable(state_db, STATE_PORT_TABLE_NAME, CONFIGDB_TABLE_NAME_SEPARATOR)
lguohan
left a comment
There was a problem hiding this comment.
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 <shuche@microsoft.com>
|
updated |
lguohan
left a comment
There was a problem hiding this comment.
can you show the output of the state db after this patch?
portsyncd/linksync.cpp
Outdated
| if (!g_init && g_portSet.find(key) != g_portSet.end()) | ||
| { | ||
| g_portSet.erase(key); | ||
| FieldValueTuple tuple("state", "TRUE"); |
|
…) 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
…d of hardcoded in a map (sonic-net#336)
Signed-off-by: Shu0T1an ChenG shuche@microsoft.com