Skip to content

Commit cbcdc82

Browse files
authored
[warm-reboot]: Do not clean up mirror session state database (sonic-net#639)
In order to maintain the same monitor port across the warm reboot, exclude the mirror session state database. Signed-off-by: Shu0T1an ChenG <[email protected]>
1 parent b943d67 commit cbcdc82

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

scripts/fast-reboot

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,10 +187,11 @@ function backup_database()
187187
debug "Backing up database ..."
188188
# Dump redis content to a file 'dump.rdb' in warmboot directory
189189
mkdir -p $WARM_DIR
190-
# Delete keys in stateDB except FDB_TABLE|* and WARM_RESTA*
190+
# Delete keys in stateDB except FDB_TABLE|*, MIRROR_SESSION_TABLE|*, WARM_RESTART_ENABLE_TABLE|*
191191
redis-cli -n 6 eval "
192192
for _, k in ipairs(redis.call('keys', '*')) do
193193
if not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \
194+
and not string.match(k, 'MIRROR_SESSION_TABLE|') \
194195
and not string.match(k, 'WARM_RESTART_ENABLE_TABLE|') then
195196
redis.call('del', k)
196197
end

0 commit comments

Comments
 (0)