Skip to content

Commit 7acd028

Browse files
authored
[gbsyncd] Add asic db prefix for channel RESTARTQUERY (#1302)
* Use different channel RESTARTQUERY for syncd/gbsyncd * change restartquery to restartQuery due to aspell error
1 parent 15fa907 commit 7acd028

File tree

3 files changed

+14
-2
lines changed

3 files changed

+14
-2
lines changed

syncd/RequestShutdown.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ void RequestShutdown::send()
3737

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

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

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

syncd/RequestShutdown.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,18 @@
99

1010
#define SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY "RESTARTQUERY"
1111

12+
/**
13+
* @brief Notification channel 'restartQuery' per DB scope
14+
*
15+
* In https://redis.io/docs/manual/pubsub/, it says:
16+
* "Pub/Sub has no relation to the key space. It was made to not interfere with
17+
* it on any level, including database numbers."
18+
*/
19+
#define SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY_PER_DB(dbName) \
20+
((dbName) == "ASIC_DB" ? \
21+
SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY : \
22+
(dbName) + "_" + SYNCD_NOTIFICATION_CHANNEL_RESTARTQUERY)
23+
1224
namespace syncd
1325
{
1426
class RequestShutdown

syncd/Syncd.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -161,7 +161,7 @@ Syncd::Syncd(
161161

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

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

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

0 commit comments

Comments
 (0)