Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cherry-pick the community PR #3111 "Backup STATE_DB PORT_TABLE|Ethernet during warm-reboot". #34

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion scripts/fast-reboot
Original file line number Diff line number Diff line change
Expand Up @@ -247,7 +247,17 @@ function backup_database()
# Delete keys in stateDB except FDB_TABLE|*, MIRROR_SESSION_TABLE|*, WARM_RESTART_ENABLE_TABLE|*, FG_ROUTE_TABLE|*
sonic-db-cli STATE_DB eval "
for _, k in ipairs(redis.call('keys', '*')) do
if not string.match(k, 'FDB_TABLE|') and not string.match(k, 'WARM_RESTART_TABLE|') \
if string.match(k, 'PORT_TABLE|Ethernet') then
for i, f in ipairs(redis.call('hgetall', k)) do
if i % 2 == 1 then
if not string.match(f, 'host_tx_ready') \
and not string.match(f, 'NPU_SI_SETTINGS_SYNC_STATUS') \
and not string.match(f, 'CMIS_REINIT_REQUIRED') then
redis.call('hdel', k, f)
end
end
end
elseif 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, 'FG_ROUTE_TABLE|') \
and not string.match(k, 'WARM_RESTART_ENABLE_TABLE|') \
Expand Down
Loading