Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/202305' into 202305
Browse files Browse the repository at this point in the history
  • Loading branch information
JunhongMao committed Feb 1, 2024
2 parents dbb9532 + 412d56a commit c8b5891
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion syncd/RequestShutdown.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ void RequestShutdown::send()

swss::DBConnector db(m_contextConfig->m_dbAsic, 0);

swss::NotificationProducer restartQuery(&db, SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY);
swss::NotificationProducer restartQuery(&db, SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY_PER_DB(m_contextConfig->m_dbAsic));

std::vector<swss::FieldValueTuple> values;

Expand Down
12 changes: 12 additions & 0 deletions syncd/RequestShutdown.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,18 @@

#define SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY "RESTARTQUERY"

/**
* @brief Notification channel 'restartQuery' per DB scope
*
* In https://redis.io/docs/manual/pubsub/, it says:
* "Pub/Sub has no relation to the key space. It was made to not interfere with
* it on any level, including database numbers."
*/
#define SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY_PER_DB(dbName) \
((dbName) == "ASIC_DB" ? \
SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY : \
(dbName) + "_" + SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY)

namespace syncd
{
class RequestShutdown
Expand Down
2 changes: 1 addition & 1 deletion syncd/Syncd.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Syncd::Syncd(

m_handler->setSwitchNotifications(m_sn.getSwitchNotifications());

m_restartQuery = std::make_shared<swss::NotificationConsumer>(m_dbAsic.get(), SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY);
m_restartQuery = std::make_shared<swss::NotificationConsumer>(m_dbAsic.get(), SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY_PER_DB(m_contextConfig->m_dbAsic));

// TODO to be moved to ASIC_DB
m_dbFlexCounter = std::make_shared<swss::DBConnector>(m_contextConfig->m_dbFlex, 0);
Expand Down

0 comments on commit c8b5891

Please sign in to comment.