From d0a2717f4590ae23d44ad0c4c141a7e83ac98cf6 Mon Sep 17 00:00:00 2001 From: Vaibhav Hemant Dixit Date: Fri, 14 Oct 2022 18:19:44 +0000 Subject: [PATCH] Merged PR 6918507: Fix fastreboot patch to shutdown SLB neighbors during fastboot Fix fastreboot path to shutdown SLB neighbors during fastboot This issue was found when the new build on internal branch started failing. Build failure log: ``` Applying patch ../sonic-utilities.patch/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch patching file scripts/fast-reboot Hunk #1 succeeded at 43 with fuzz 1 (offset 7 lines). Hunk #2 FAILED at 123. Hunk #3 succeeded at 502 with fuzz 1 (offset 81 lines). Hunk #4 succeeded at 582 (offset 95 lines). 1 out of 4 hunks FAILED -- rejects in file scripts/fast-reboot ``` Repro'd this locally: ``` vadixit@DevVM-20:~/workspace/Networking-acs-buildimage/src/sonic-utilities$ quilt push -a Applying patch patches/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch patching file scripts/fast-reboot Hunk #1 succeeded at 42 with fuzz 1 (offset 6 lines). Hunk #2 FAILED at 123. Hunk #3 succeeded at 489 with fuzz 1 (offset 68 lines). Hunk #4 succeeded at 569 (offset 82 lines). 1 out of 4 hunks FAILED -- rejects in file scripts/fast-reboot Patch patches/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch does not apply (enforce with -f) ``` Issue fixed with this change: ``` vadixit@DevVM-20:~/workspace/Networking-acs-buildimage/src/sonic-utilities$ quilt push -a Applying patch patches/0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch patching file scripts/fast-reboot Now at patch patches/0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch ``` Additionally, changed the series file and renamed the 0002 patch as 0001 patch as this is the only patch on this branch right now. --- ...-Handle-SLB-neighbors-shutdown-duri.patch} | 40 +++++++------------ src/sonic-utilities.patch/series | 2 +- 2 files changed, 16 insertions(+), 26 deletions(-) rename src/sonic-utilities.patch/{0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch => 0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch} (62%) diff --git a/src/sonic-utilities.patch/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch b/src/sonic-utilities.patch/0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch similarity index 62% rename from src/sonic-utilities.patch/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch rename to src/sonic-utilities.patch/0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch index 5c8b294979b4..b45171a84a63 100644 --- a/src/sonic-utilities.patch/0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch +++ b/src/sonic-utilities.patch/0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch @@ -1,36 +1,26 @@ -From 7d0a63278aa5eedadd48db3937fa0139f3411669 Mon Sep 17 00:00:00 2001 -From: Vaibhav Hemant Dixit -Date: Fri, 23 Jul 2021 16:27:56 -0700 -Subject: [PATCH] [fast-reboot][patch] Restore SLB neighbors state after - fast-reboot failure - ---- - scripts/fast-reboot | 31 +++++++++++++++++++++++++++++++ - 1 file changed, 31 insertions(+) - -Index: sonic-utilities/scripts/fast-reboot -=================================================================== ---- sonic-utilities.orig/scripts/fast-reboot -+++ sonic-utilities/scripts/fast-reboot -@@ -36,6 +36,7 @@ EXIT_ORCHAGENT_SHUTDOWN=10 - EXIT_FILTER_FDB_ENTRIES_FAILURE=13 +diff --git a/scripts/fast-reboot b/scripts/fast-reboot +index 00ed1a5..9a6bc33 100755 +--- a/scripts/fast-reboot ++++ b/scripts/fast-reboot +@@ -42,6 +42,7 @@ EXIT_ORCHAGENT_SHUTDOWN=10 + EXIT_SYNCD_SHUTDOWN=11 EXIT_COUNTERPOLL_DELAY_FAILURE=14 EXIT_DB_INTEGRITY_FAILURE=15 +EXIT_HANDLE_SLB_NEIGHBORS=200 EXIT_NO_CONTROL_PLANE_ASSISTANT=20 EXIT_SONIC_INSTALLER_VERIFY_REBOOT=21 - -@@ -122,6 +123,8 @@ function clear_fast_boot() - common_clear - - sonic-db-cli STATE_DB DEL "FAST_REBOOT|system" &>/dev/null || /bin/true + EXIT_PLATFORM_FW_AU_FAILURE=22 +@@ -145,6 +146,8 @@ function clear_boot() + if [[ "$REBOOT_TYPE" = "fast-reboot" ]]; then + sonic-db-cli STATE_DB DEL "FAST_REBOOT|system" &>/dev/null || /bin/true + fi + + handle_slb_neighbors restore } - function clear_warm_boot() -@@ -420,6 +423,32 @@ function check_warm_restart_in_progress( - done + function init_warm_reboot_states() +@@ -488,6 +491,32 @@ function check_conflict_boot_in_fw_update() { + fi } +function handle_slb_neighbors() @@ -62,7 +52,7 @@ Index: sonic-utilities/scripts/fast-reboot # main starts here parseOptions $@ -@@ -460,6 +489,8 @@ case "$REBOOT_TYPE" in +@@ -542,6 +571,8 @@ case "$REBOOT_TYPE" in ;; esac diff --git a/src/sonic-utilities.patch/series b/src/sonic-utilities.patch/series index 7831186157ac..d54741525040 100644 --- a/src/sonic-utilities.patch/series +++ b/src/sonic-utilities.patch/series @@ -1 +1 @@ -0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch +0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch \ No newline at end of file