Skip to content

Commit

Permalink
[warm-reboot]: Do not clean up mirror session state database (sonic-n…
Browse files Browse the repository at this point in the history
…et#639)

In order to maintain the same monitor port across the warm reboot,
exclude the mirror session state database.

Signed-off-by: Shu0T1an ChenG <shuche@microsoft.com>
  • Loading branch information
stcheng authored Sep 13, 2019
1 parent b943d67 commit cbcdc82
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -187,10 +187,11 @@ function backup_database()
debug "Backing up database ..."
# Dump redis content to a file 'dump.rdb' in warmboot directory
mkdir -p $WARM_DIR
# Delete keys in stateDB except FDB_TABLE|* and WARM_RESTA*
# Delete keys in stateDB except FDB_TABLE|*, MIRROR_SESSION_TABLE|*, WARM_RESTART_ENABLE_TABLE|*
redis-cli -n 6 eval "
for _, k in ipairs(redis.call('keys', '*')) do
if not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \
and not string.match(k, 'MIRROR_SESSION_TABLE|') \
and not string.match(k, 'WARM_RESTART_ENABLE_TABLE|') then
redis.call('del', k)
end
Expand Down

0 comments on commit cbcdc82

Please sign in to comment.