Enable background of arp calls in OCF ip scripts

Arp calls were waiting to timeout which caused the action to take 6 seconds
By backgrounding the arp calls it takes 0.2 seconds
This speeds up the critical path for SM and makes swact faster

Change-Id: Ie0e2b7cff35852bf5867e5394e6f0f29cef5d274
Signed-off-by: Al Bailey <Al.Bailey@windriver.com>
Signed-off-by: Scott Little <scott.little@windriver.com>
This commit is contained in:
Al Bailey 2018-05-28 14:57:07 -05:00 committed by Scott Little
parent dad45a06a5
commit 2d7009011b
3 changed files with 69 additions and 0 deletions

View File

@ -10,3 +10,4 @@ ipaddr2-if-down.patch
spec-add-ipaddr2-ignore-lo-state.patch
Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop.patch
Disable-creation-of-the-debug-package.patch
metapatch-for-arp_bg.patch

View File

@ -0,0 +1,32 @@
From 6dc3b747b2688498a69d3ca8f826f30aecfc9f5b Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Mon, 28 May 2018 14:12:45 -0500
Subject: [PATCH] metapatch for arp_bg
---
SPECS/resource-agents.spec | 2 ++
1 file changed, 2 insertions(+)
diff --git a/SPECS/resource-agents.spec b/SPECS/resource-agents.spec
index 2536cb7..5b38434 100644
--- a/SPECS/resource-agents.spec
+++ b/SPECS/resource-agents.spec
@@ -253,6 +253,7 @@ Patch1117: lvm_cleanup_refs_on_stop.patch
Patch1118: ipaddr2_if_down.patch
Patch1119: ipaddr2_ignore_lo_if_state.patch
Patch1120: Modify-error-code-of-bz1454699-fix-to-prevent-inactive-controller-reboot-loop.patch
+Patch1121: Re-enable-background-execution-of-arp-commands.patch
Obsoletes: heartbeat-resources <= %{version}
Provides: heartbeat-resources = %{version}
@@ -563,6 +564,7 @@ exit 1
%patch1118 -p1
%patch1119 -p1
%patch1120 -p1
+%patch1121 -p1
%build
if [ ! -f configure ]; then
--
1.8.3.1

View File

@ -0,0 +1,36 @@
From 9cdb2de3b5f1d08d74a762cfda2ade16692ef9db Mon Sep 17 00:00:00 2001
From: Al Bailey <Al.Bailey@windriver.com>
Date: Mon, 28 May 2018 14:09:47 -0500
Subject: [PATCH] WRS. Re-enable background execution of arp commands.
Typical ARP commands are taking 6 seconds due to no responses back after 7 attempts.
This change allows that delay to be backgrounded
---
heartbeat/IPaddr2 | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/heartbeat/IPaddr2 b/heartbeat/IPaddr2
index 59620d2..86009b9 100755
--- a/heartbeat/IPaddr2
+++ b/heartbeat/IPaddr2
@@ -719,12 +719,13 @@ run_send_arp() {
if [ $ARP_COUNT -ne 0 ] ; then
ARGS="-i $OCF_RESKEY_arp_interval -c $ARP_COUNT -p $SENDARPPIDFILE -I $NIC -m $MY_MAC $OCF_RESKEY_ip"
ocf_log $LOGLEVEL "$SENDARP $ARGS"
- output=$($SENDARP $ARGS 2>&1)
+ if ocf_is_true $OCF_RESKEY_arp_bg; then
+ ($SENDARP $ARGS || ocf_log err "Could not send gratuitous arps")& >&2
+ else
+ $SENDARP $ARGS || ocf_log err "Could not send gratuitous arps"
+ fi
rc=$?
if [ $rc -ne $OCF_SUCCESS ]; then
- if ! ocf_is_true $OCF_RESKEY_arp_bg; then
- ocf_log err "send_arp output: $output"
- fi
ocf_exit_reason "Could not send gratuitous arps"
exit $OCF_ERR_GENERIC
fi
--
1.8.3.1