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" : 12,
"separator": "|",
"instance" : "redis_chassis"
}
},
"VERSION" : "1.0"
Expand Down
11 changes: 11 additions & 0 deletions common/schema.h
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ namespace swss {
#define GB_ASIC_DB 9
#define GB_COUNTERS_DB 10
#define GB_FLEX_COUNTER_DB 11
#define CHASSIS_APP_DB 12

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

Expand Down Expand Up @@ -74,6 +75,8 @@ namespace swss {

#define APP_MUX_CABLE_TABLE_NAME "MUX_CABLE_TABLE"
#define APP_HW_MUX_CABLE_TABLE_NAME "HW_MUX_CABLE_TABLE"

#define APP_SYSTEM_PORT_TABLE_NAME "SYSTEM_PORT_TABLE"

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

Expand Down Expand Up @@ -278,6 +281,12 @@ namespace swss {

#define CFG_TUNNEL_TABLE_NAME "TUNNEL"

#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 @@ -310,6 +319,8 @@ namespace swss {
#define STATE_MUX_CABLE_TABLE_NAME "MUX_CABLE_TABLE"
#define STATE_HW_MUX_CABLE_TABLE_NAME "HW_MUX_CABLE_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