Skip to content
Merged
10 changes: 10 additions & 0 deletions common/database_config.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@
"hostname" : "127.0.0.1",
"port" : 6379,
"unix_socket_path" : "/var/run/redis/redis.sock"
},
"redis_chassis":{
"hostname" : "redis_chassis.server"
"port" : 6380,
"unix_socket_path" : "/var/run/redis/redis_chassis.sock"
Copy link
Copy Markdown
Contributor

@qiluo-msft qiluo-msft Aug 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please move chassis specific configuration out of the default database_config.json. The file here is to maintain backward-compatibility to before multi-DB feature and minimal configuration for any sonic system.

For example, this file does not work with sonic-utilities.

If your use case need customization, just customize it and overwrite it in your use case only. Do not break others.

}
},
"DATABASES" : {
Expand Down Expand Up @@ -71,6 +76,11 @@
"id" : 11,
"separator": "|",
"instance" : "redis"
},
"CHASSIS_APP_DB" : {
"id" : 8,
"separator": "|",
"instance" : "redis_chassis"
}
},
"VERSION" : "1.0"
Expand Down
14 changes: 14 additions & 0 deletions common/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ namespace swss {
#define GB_COUNTERS_DB 10
#define GB_FLEX_COUNTER_DB 11

//For chassis app db in supervisor/control card redis in chassis systems.
//This DB ID is not to be used in local redis.
#define CHASSIS_APP_DB 8

/***** APPLICATION DATABASE *****/

#define APP_PORT_TABLE_NAME "PORT_TABLE"
Expand Down Expand Up @@ -72,6 +76,8 @@ namespace swss {
#define APP_STP_FASTAGEING_FLUSH_TABLE_NAME "STP_FASTAGEING_FLUSH_TABLE"
#define APP_STP_BPDU_GUARD_TABLE_NAME "STP_BPDU_GUARD_TABLE"

#define APP_SYSTEM_PORT_TABLE_NAME "SYSTEM_PORT_TABLE"

/***** TO BE REMOVED *****/

#define APP_TC_TO_QUEUE_MAP_TABLE_NAME "TC_TO_QUEUE_MAP_TABLE"
Expand Down Expand Up @@ -268,6 +274,12 @@ namespace swss {
#define CFG_FG_NHG_PREFIX "FG_NHG_PREFIX"
#define CFG_FG_NHG_MEMBER "FG_NHG_MEMBER"

#define CFG_SYSTEM_PORT_TABLE_NAME "SYSTEM_PORT"
#define CFG_VOQ_INBAND_INTERFACE_TABLE_NAME "VOQ_INBAND_INTERFACE"

#define CHASSIS_APP_SYSTEM_INTERFACE_TABLE_NAME "SYSTEM_INTERFACE"
#define CHASSIS_APP_SYSTEM_NEIGH_TABLE_NAME "SYSTEM_NEIGH"

/***** STATE DATABASE *****/

#define STATE_SWITCH_CAPABILITY_TABLE_NAME "SWITCH_CAPABILITY_TABLE"
Expand Down Expand Up @@ -296,6 +308,8 @@ namespace swss {
#define STATE_COPP_GROUP_TABLE_NAME "COPP_GROUP_TABLE"
#define STATE_COPP_TRAP_TABLE_NAME "COPP_TRAP_TABLE"
#define STATE_FG_ROUTE_TABLE_NAME "FG_ROUTE_TABLE"

#define STATE_SYSTEM_NEIGH_TABLE_NAME "SYSTEM_NEIGH_TABLE"
/***** MISC *****/

#define IPV4_NAME "IPv4"
Expand Down
3 changes: 2 additions & 1 deletion common/table.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const TableNameSeparatorMap TableBase::tableNameSeparatorMap = {
{ RESTAPI_DB, TABLE_NAME_SEPARATOR_VBAR },
{ GB_ASIC_DB, TABLE_NAME_SEPARATOR_VBAR },
{ GB_COUNTERS_DB, TABLE_NAME_SEPARATOR_VBAR },
{ GB_FLEX_COUNTER_DB, TABLE_NAME_SEPARATOR_VBAR }
{ GB_FLEX_COUNTER_DB, TABLE_NAME_SEPARATOR_VBAR },
{ CHASSIS_APP_DB, TABLE_NAME_SEPARATOR_VBAR }
};

Table::Table(const DBConnector *db, const string &tableName)
Expand Down