diff --git a/syncd/RequestShutdown.cpp b/syncd/RequestShutdown.cpp index 444fa742d..2daf2cc6e 100644 --- a/syncd/RequestShutdown.cpp +++ b/syncd/RequestShutdown.cpp @@ -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 values; diff --git a/syncd/RequestShutdown.h b/syncd/RequestShutdown.h index 5688763a7..833f57efe 100644 --- a/syncd/RequestShutdown.h +++ b/syncd/RequestShutdown.h @@ -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 diff --git a/syncd/Syncd.cpp b/syncd/Syncd.cpp index 103d8820a..1f1b11b15 100644 --- a/syncd/Syncd.cpp +++ b/syncd/Syncd.cpp @@ -157,7 +157,7 @@ Syncd::Syncd( m_handler->setSwitchNotifications(m_sn.getSwitchNotifications()); - m_restartQuery = std::make_shared(m_dbAsic.get(), SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY); + m_restartQuery = std::make_shared(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(m_contextConfig->m_dbFlex, 0);