Skip to content

Commit 5154f42

Browse files
committed
revert change - dump arp and fdb for reconciliation
1 parent 83770a5 commit 5154f42

File tree

1 file changed

+24
-9
lines changed

1 file changed

+24
-9
lines changed

scripts/fast-reboot

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ EXIT_FILE_SYSTEM_FULL=3
4141
EXIT_NEXT_IMAGE_NOT_EXISTS=4
4242
EXIT_ORCHAGENT_SHUTDOWN=10
4343
EXIT_SYNCD_SHUTDOWN=11
44+
EXIT_FAST_REBOOT_DUMP_FAILURE=12
45+
EXIT_FILTER_FDB_ENTRIES_FAILURE=13
4446
EXIT_COUNTERPOLL_DELAY_FAILURE=14
4547
EXIT_DB_INTEGRITY_FAILURE=15
4648
EXIT_NO_CONTROL_PLANE_ASSISTANT=20
@@ -601,6 +603,28 @@ else
601603
load_kernel
602604
fi
603605
606+
if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
607+
# Dump the ARP and FDB tables to files also as default routes for both IPv4 and IPv6
608+
# into /host/fast-reboot
609+
DUMP_DIR=/host/fast-reboot
610+
mkdir -p $DUMP_DIR
611+
FAST_REBOOT_DUMP_RC=0
612+
/usr/local/bin/fast-reboot-dump.py -t $DUMP_DIR || FAST_REBOOT_DUMP_RC=$?
613+
if [[ FAST_REBOOT_DUMP_RC -ne 0 ]]; then
614+
error "Failed to run fast-reboot-dump.py. Exit code: $FAST_REBOOT_DUMP_RC"
615+
unload_kernel
616+
exit "${EXIT_FAST_REBOOT_DUMP_FAILURE}"
617+
fi
618+
FILTER_FDB_ENTRIES_RC=0
619+
# Filter FDB entries using MAC addresses from ARP table
620+
/usr/local/bin/filter_fdb_entries -f $DUMP_DIR/fdb.json -a $DUMP_DIR/arp.json -c $CONFIG_DB_FILE || FILTER_FDB_ENTRIES_RC=$?
621+
if [[ FILTER_FDB_ENTRIES_RC -ne 0 ]]; then
622+
error "Failed to filter FDb entries. Exit code: $FILTER_FDB_ENTRIES_RC"
623+
unload_kernel
624+
exit "${EXIT_FILTER_FDB_ENTRIES_FAILURE}"
625+
fi
626+
fi
627+
604628
init_warm_reboot_states
605629
606630
setup_control_plane_assistant
@@ -631,15 +655,6 @@ if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then
631655
unload_kernel
632656
exit "${EXIT_COUNTERPOLL_DELAY_FAILURE}"
633657
fi
634-
635-
# Clear all routes except of default routes for faster reconciliation time.
636-
sonic-db-cli APPL_DB eval "
637-
for _, k in ipairs(redis.call('keys', '*')) do
638-
if string.match(k, 'ROUTE_TABLE:') and not string.match(k, 'ROUTE_TABLE:0.0.0.0/0') and not string.match(k, 'ROUTE_TABLE:::/0') then \
639-
redis.call('del', k)
640-
end
641-
end
642-
" 0 > /dev/null
643658
fi
644659
645660
# We are fully committed to reboot from this point on because critical

0 commit comments

Comments
 (0)