Skip to content

Commit

Permalink
Merged PR 6918507: Fix fastreboot patch to shutdown SLB neighbors dur…
Browse files Browse the repository at this point in the history
…ing 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.
  • Loading branch information
Vaibhav Hemant Dixit committed Oct 14, 2022
1 parent 3957402 commit d0a2717
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 26 deletions.
Original file line number Diff line number Diff line change
@@ -1,36 +1,26 @@
From 7d0a63278aa5eedadd48db3937fa0139f3411669 Mon Sep 17 00:00:00 2001
From: Vaibhav Hemant Dixit <[email protected]>
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()
Expand Down Expand Up @@ -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

Expand Down
2 changes: 1 addition & 1 deletion src/sonic-utilities.patch/series
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0002-Stopping-all-BGP-SLB-neighbors-if-they-re-presented-.patch
0001-fast-reboot-patch-Handle-SLB-neighbors-shutdown-duri.patch

0 comments on commit d0a2717

Please sign in to comment.