From 674a5e6c74741e78e64ecd0bfab02b3be5ca8f54 Mon Sep 17 00:00:00 2001 From: Jipan Yang Date: Wed, 8 Aug 2018 14:44:56 -0700 Subject: [PATCH] Warm reboot: Add basic schema for warm start in configDB and stateDB. (#553) * Add basic schema for warm start schema in configDB and application DB. Signed-off-by: Jipan Yang * Move warm start table for process stats to state DB Signed-off-by: Jipan Yang * Add reconciliation timer entry in configDB warm restart table. Signed-off-by: Jipan Yang * Update warm restart timer schema Signed-off-by: Jipan Yang * There might be more than one timer at system level or individual docker Signed-off-by: Jipan Yang --- doc/swss-schema.md | 43 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 41 insertions(+), 2 deletions(-) diff --git a/doc/swss-schema.md b/doc/swss-schema.md index 8ab08ff382..124cb6d590 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,44 @@ Equivalent RedisDB entry: 12) "0" 127.0.0.1:6379> -### Configuration files + +## 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. + ; 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". 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 + +### 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? [port_config.ini](https://github.com/stcheng/swss/blob/mock/portsyncd/port_config.ini) - defines physical port information