Skip to content

Commit

Permalink
Merge branch 'master' into fdbflush
Browse files Browse the repository at this point in the history
  • Loading branch information
kcudnik authored Nov 12, 2023
2 parents 0581d2b + a1b2e51 commit d46188d
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 3 deletions.
2 changes: 1 addition & 1 deletion syncd/NotificationProcessor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -528,7 +528,7 @@ void NotificationProcessor::process_on_bfd_session_state_change(
* switch vid.
*/

bfd_session_state->bfd_session_id = m_translator->translateRidToVid(bfd_session_state->bfd_session_id, SAI_NULL_OBJECT_ID);
bfd_session_state->bfd_session_id = m_translator->translateRidToVid(bfd_session_state->bfd_session_id, SAI_NULL_OBJECT_ID, true);
}

std::string s = sai_serialize_bfd_session_state_ntf(count, data);
Expand Down
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 @@ -161,7 +161,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 d46188d

Please sign in to comment.