Skip to content

Commit d27f49e

Browse files
jipanyangyxieca
authored andcommitted
Move warm_restart enable/disable config to stateDB WARM_RESTART_ENABLE_TABLE (sonic-net#786)
Signed-off-by: Jipan Yang <jipan.yang@alibaba-inc.com>
1 parent 6363985 commit d27f49e

File tree

2 files changed

+16
-23
lines changed

2 files changed

+16
-23
lines changed

doc/swss-schema.md

+13-6
Original file line numberDiff line numberDiff line change
@@ -695,10 +695,6 @@ Stores information for physical switch ports managed by the switch chip. Ports t
695695

696696
key = WARM_RESTART:name ; name is the name of SONiC docker or "system" for global configuration.
697697

698-
enable = "true" / "false" ; Default value as false.
699-
; If "system" warm start knob is true, docker level knob will be ignored.
700-
; If "system" warm start knob is false, docker level knob takes effect.
701-
702698
neighsyncd_timer = 1*4DIGIT ; neighsyncd_timer is the timer used for neighsyncd during the warm restart.
703699
; Timer is started after we restored the neighborTable to internal data structures.
704700
; neighborsyncd then starts to read all linux kernel entries and mark the entries in
@@ -715,8 +711,8 @@ Stores information for physical switch ports managed by the switch chip. Ports t
715711
; Supported range: 1-3600.
716712

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

761+
### WARM\_RESTART\_ENABLE\_TABLE
762+
;Stores system warm start and docker warm start enable/disable configuration
763+
;The configuration is persistent across warm reboot but not cold reboot.
764+
;Status: work in progress
765+
766+
key = WARM_RESTART_ENABLE_TABLE:name ; name is the name of SONiC docker or "system" for global configuration.
767+
768+
enable = "true" / "false" ; Default value as false.
769+
; If "system" warm start knob is true, docker level knob will be ignored.
770+
; If "system" warm start knob is false, docker level knob takes effect.
771+
765772
### WARM\_RESTART\_TABLE
766773
;Stores application and orchdameon warm start status
767774
;Status: work in progress

tests/test_warm_reboot.py

+3-17
Original file line numberDiff line numberDiff line change
@@ -948,19 +948,6 @@ def set_restart_timer(dvs, db, app_name, value):
948948
]
949949
)
950950

951-
952-
# Temporary instruction to activate warm_restart. To be deleted once equivalent CLI
953-
# function is pushed to sonic-utils.
954-
def enable_warmrestart(dvs, db, app_name):
955-
create_entry_tbl(
956-
db,
957-
swsscommon.CFG_WARM_RESTART_TABLE_NAME, app_name,
958-
[
959-
("enable", "true"),
960-
]
961-
)
962-
963-
964951
################################################################################
965952
#
966953
# Routing warm-restart testcases
@@ -1096,10 +1083,9 @@ def test_routing_WarmRestart(dvs, testlog):
10961083
# Enabling bgp warmrestart and setting restart timer.
10971084
# The following two instructions will be substituted by the commented ones
10981085
# once the later ones are added to sonic-utilities repo.
1099-
enable_warmrestart(dvs, conf_db, "bgp")
1100-
set_restart_timer(dvs, conf_db, "bgp", str(restart_timer))
1101-
#dvs.runcmd("config warm_restart enable bgp")
1102-
#dvs.runcmd("config warm_restart bgp_timer {}".format(restart_timer))
1086+
1087+
dvs.runcmd("config warm_restart enable bgp")
1088+
dvs.runcmd("config warm_restart bgp_timer {}".format(restart_timer))
11031089

11041090
time.sleep(1)
11051091

0 commit comments

Comments
 (0)