From be4391b496d3a7e985b65dcce28d938773a21ff5 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Fri, 27 Jul 2018 14:40:57 -0700 Subject: [PATCH 1/5] Add basic schema for warm start schema in configDB and application DB. Signed-off-by: Jipan Yang --- doc/swss-schema.md | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index 8ab08ff382..6f05219f43 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -1,11 +1,13 @@ Schema data is defined in ABNF [RFC5234](https://tools.ietf.org/html/rfc5234) syntax. -### Definitions of common tokens +## Definitions of common tokens name = 1*DIGIT/1*ALPHA ref_hash_key_reference = "[" hash_key "]" ;The token is a refernce to another valid DB key. hash_key = name ; a valid key name (i.e. exists in DB) +## Application DB schema + ### PORT_TABLE Stores information for physical switch ports managed by the switch chip. device_names are defined in [port_config.ini](../portsyncd/port_config.ini). Ports to the CPU (ie: management port) and logical ports (loopback) are not declared in the PORT_TABLE. See INTF_TABLE. @@ -620,7 +622,27 @@ Equivalent RedisDB entry: 12) "0" 127.0.0.1:6379> -### Configuration files +--------------------------------------------- +### WARM\_RESTART\_TABLE + ;Stores application and orchdameon warm start status + ;Status: work in progress + key = WARM_RESTART_TABLE:process_name ; process_name is unique process identifier + restart_count = 1*10DIGIT ; a number between 0 and 2147483647, + ; count of warm start times. + state = "init" / "restored" / "synced" + + +## Configuration DB schema + +### WARM\_RESTART + ;Stores system warm start configuration + ;Status: work in progress + + key = WARM_RESTART:name ; name is the name of SONiC docker or "system" for global configuration + enable = "true" / "false" ; default value as false + + +## Configuration files What configuration files should we have? Do apps, orch agent each need separate files? [port_config.ini](https://github.com/stcheng/swss/blob/mock/portsyncd/port_config.ini) - defines physical port information From b6f7a644f5140986494aef950d248784488a1296 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Wed, 1 Aug 2018 13:53:28 -0700 Subject: [PATCH 2/5] Move warm start table for process stats to state DB Signed-off-by: Jipan Yang --- doc/swss-schema.md | 26 +++++++++++++++++--------- 1 file changed, 17 insertions(+), 9 deletions(-) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index 6f05219f43..e7273b963e 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -622,15 +622,6 @@ Equivalent RedisDB entry: 12) "0" 127.0.0.1:6379> ---------------------------------------------- -### WARM\_RESTART\_TABLE - ;Stores application and orchdameon warm start status - ;Status: work in progress - key = WARM_RESTART_TABLE:process_name ; process_name is unique process identifier - restart_count = 1*10DIGIT ; a number between 0 and 2147483647, - ; count of warm start times. - state = "init" / "restored" / "synced" - ## Configuration DB schema @@ -642,6 +633,23 @@ Equivalent RedisDB entry: enable = "true" / "false" ; default value as false +## State DB schema + +### WARM\_RESTART\_TABLE + ;Stores application and orchdameon warm start status + ;Status: work in progress + + key = WARM_RESTART_TABLE:process_name ; process_name is a unique process identifier. + restart_count = 1*10DIGIT ; a number between 0 and 2147483647, + ; count of warm start times. + + state = "init" / "restored" / "reconciled" ; init: process init with warm start enabled. + ; restored: process restored to the previous + ; state using saved data. + ; reconciled: process reconciled with up to date + ; dynanic data like port state, neighbor, routes + ; and so on. + ## Configuration files What configuration files should we have? Do apps, orch agent each need separate files? From 822d25cea885583e22874ce34756f75d633e959d Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Wed, 1 Aug 2018 14:02:24 -0700 Subject: [PATCH 3/5] Add reconciliation timer entry in configDB warm restart table. Signed-off-by: Jipan Yang --- doc/swss-schema.md | 1 + 1 file changed, 1 insertion(+) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index e7273b963e..ea7ef0a5b4 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -631,6 +631,7 @@ Equivalent RedisDB entry: key = WARM_RESTART:name ; name is the name of SONiC docker or "system" for global configuration enable = "true" / "false" ; default value as false + timer = 1*4DIGIT ; timer to determine when reconciliation is done, in seconds. ## State DB schema From 416bc27b117c4c0589095c9779b030bfb81e5361 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Fri, 3 Aug 2018 12:05:00 -0700 Subject: [PATCH 4/5] Update warm restart timer schema Signed-off-by: Jipan Yang --- doc/swss-schema.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index ea7ef0a5b4..ae5bf1a110 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -629,10 +629,16 @@ Equivalent RedisDB entry: ;Stores system warm start configuration ;Status: work in progress - key = WARM_RESTART:name ; name is the name of SONiC docker or "system" for global configuration - enable = "true" / "false" ; default value as false - timer = 1*4DIGIT ; timer to determine when reconciliation is done, in seconds. + key = WARM_RESTART:name ; name is the name of SONiC docker or "system" for global configuration. + enable = "true" / "false" ; Default value as false. + ; If "system" warm start knob is true, docker level knob will be ignored. + ; If "system" warm start knob is false, docker level knob takes effect. + + timer_name = 1*255VCHAR ; timer_name is the name of warm start timer for the whole system or the specific docker, + ; Ex. "neighbor_timer", "bgp_timer". + ; There could be more than one timer in a docker and the system. + timer_duration = 1*4DIGIT ; timer duration, in seconds. ## State DB schema From 3720444fbb010968a3e76851d1b3d3d113630801 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Mon, 6 Aug 2018 17:37:22 -0700 Subject: [PATCH 5/5] There might be more than one timer at system level or individual docker Signed-off-by: Jipan Yang --- doc/swss-schema.md | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index ae5bf1a110..124cb6d590 100644 --- a/doc/swss-schema.md +++ b/doc/swss-schema.md @@ -635,10 +635,12 @@ Equivalent RedisDB entry: ; If "system" warm start knob is true, docker level knob will be ignored. ; If "system" warm start knob is false, docker level knob takes effect. - timer_name = 1*255VCHAR ; timer_name is the name of warm start timer for the whole system or the specific docker, - ; Ex. "neighbor_timer", "bgp_timer". - ; There could be more than one timer in a docker and the system. - timer_duration = 1*4DIGIT ; timer duration, in seconds. + timer_name = 1*255VCHAR, ; timer_name is the name of warm start timer for the whole system or the specific docker, + ; Ex. "neighbor_timer", "bgp_timer". The name should not contain "," character. + ; There could be more than one timer in a docker or the system, separated by ",". + + timer_duration = 1*4DIGIT, ; timer duration, in seconds. Separated by "," if there are more than on timer. + ## State DB schema