Skip to content

Commit

Permalink
Move warm_restart enable/disable config to stateDB WARM_RESTART_ENABL…
Browse files Browse the repository at this point in the history
…E_TABLE (sonic-net#786)

Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
  • Loading branch information
jipanyang authored and yxieca committed Feb 13, 2019
1 parent 6363985 commit d27f49e
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 23 deletions.
19 changes: 13 additions & 6 deletions doc/swss-schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -695,10 +695,6 @@ Stores information for physical switch ports managed by the switch chip. Ports t

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.

neighsyncd_timer = 1*4DIGIT ; neighsyncd_timer is the timer used for neighsyncd during the warm restart.
; Timer is started after we restored the neighborTable to internal data structures.
; neighborsyncd then starts to read all linux kernel entries and mark the entries in
Expand All @@ -715,8 +711,8 @@ Stores information for physical switch ports managed by the switch chip. Ports t
; Supported range: 1-3600.

teamsyncd_timer = 1*4DIGIT ; teamsyncd_timer holds the time interval utilized by teamsyncd during warm-restart episodes.
; The timer is started when teamsyncd starts. During the timer interval teamsyncd
; will preserver all LAG interface changes, but it will not apply them. The changes
; The timer is started when teamsyncd starts. During the timer interval teamsyncd
; will preserver all LAG interface changes, but it will not apply them. The changes
; will only be applied when the timer expired. During the changes application the stale
; LAG entries will be removed, the new LAG entries will be created.
; Supported range: 1-9999. 0 is invalid
Expand Down Expand Up @@ -762,6 +758,17 @@ Stores information for physical switch ports managed by the switch chip. Ports t
key = MGMT_PORT_TABLE|ifname ; ifname must be unique across PORT,INTF,VLAN,LAG TABLES
oper_status = "down" / "up" ; oper status

### WARM\_RESTART\_ENABLE\_TABLE
;Stores system warm start and docker warm start enable/disable configuration
;The configuration is persistent across warm reboot but not cold reboot.
;Status: work in progress

key = WARM_RESTART_ENABLE_TABLE: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.

### WARM\_RESTART\_TABLE
;Stores application and orchdameon warm start status
;Status: work in progress
Expand Down
20 changes: 3 additions & 17 deletions tests/test_warm_reboot.py
Original file line number Diff line number Diff line change
Expand Up @@ -948,19 +948,6 @@ def set_restart_timer(dvs, db, app_name, value):
]
)


# Temporary instruction to activate warm_restart. To be deleted once equivalent CLI
# function is pushed to sonic-utils.
def enable_warmrestart(dvs, db, app_name):
create_entry_tbl(
db,
swsscommon.CFG_WARM_RESTART_TABLE_NAME, app_name,
[
("enable", "true"),
]
)


################################################################################
#
# Routing warm-restart testcases
Expand Down Expand Up @@ -1096,10 +1083,9 @@ def test_routing_WarmRestart(dvs, testlog):
# Enabling bgp warmrestart and setting restart timer.
# The following two instructions will be substituted by the commented ones
# once the later ones are added to sonic-utilities repo.
enable_warmrestart(dvs, conf_db, "bgp")
set_restart_timer(dvs, conf_db, "bgp", str(restart_timer))
#dvs.runcmd("config warm_restart enable bgp")
#dvs.runcmd("config warm_restart bgp_timer {}".format(restart_timer))

dvs.runcmd("config warm_restart enable bgp")
dvs.runcmd("config warm_restart bgp_timer {}".format(restart_timer))

time.sleep(1)

Expand Down

0 comments on commit d27f49e

Please sign in to comment.