diff --git a/lib/RedisChannel.cpp b/lib/RedisChannel.cpp index 93567f45a2..17e061e3e7 100644 --- a/lib/RedisChannel.cpp +++ b/lib/RedisChannel.cpp @@ -25,7 +25,7 @@ RedisChannel::RedisChannel( m_getConsumer = std::make_shared(m_db.get(), REDIS_TABLE_GETRESPONSE); m_dbNtf = std::make_shared(dbAsic, 0); - m_notificationConsumer = std::make_shared(m_dbNtf.get(), REDIS_TABLE_NOTIFICATIONS); + m_notificationConsumer = std::make_shared(m_dbNtf.get(), REDIS_TABLE_NOTIFICATIONS_PER_DB(dbAsic)); m_runNotificationThread = true; diff --git a/lib/sairediscommon.h b/lib/sairediscommon.h index c095ac4721..621e8088e5 100644 --- a/lib/sairediscommon.h +++ b/lib/sairediscommon.h @@ -67,6 +67,18 @@ */ #define REDIS_TABLE_NOTIFICATIONS "NOTIFICATIONS" +/** + * @brief Table which will be used to forward notifications 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 REDIS_TABLE_NOTIFICATIONS_PER_DB(dbName) \ + ((dbName) == "ASIC_DB" ? \ + REDIS_TABLE_NOTIFICATIONS : \ + (dbName) + "_" + REDIS_TABLE_NOTIFICATIONS) + /** * @brief Table which will be used to send API response from syncd. */ diff --git a/syncd/RedisNotificationProducer.cpp b/syncd/RedisNotificationProducer.cpp index 3e19a47439..4bfb2cc0e3 100644 --- a/syncd/RedisNotificationProducer.cpp +++ b/syncd/RedisNotificationProducer.cpp @@ -13,7 +13,7 @@ RedisNotificationProducer::RedisNotificationProducer( m_db = std::make_shared(dbName, 0); - m_notificationProducer = std::make_shared(m_db.get(), REDIS_TABLE_NOTIFICATIONS); + m_notificationProducer = std::make_shared(m_db.get(), REDIS_TABLE_NOTIFICATIONS_PER_DB(dbName)); } void RedisNotificationProducer::send( diff --git a/tests/aspell.en.pws b/tests/aspell.en.pws index 1ceca3ecdf..f85a2541e8 100644 --- a/tests/aspell.en.pws +++ b/tests/aspell.en.pws @@ -231,6 +231,7 @@ inseg Inseg INSEG insegs +io ip IP ipc @@ -308,6 +309,7 @@ PORTs pre printf ptr +pubsub qos queueCounterIds queueId