gplv2/drbd-tools/centos/patches/0007-Update-OCF-to-attempt-connect-in-certain-states.patch
Dean Troyer 9c72843aa1 StarlingX open source release updates
Signed-off-by: Dean Troyer <dtroyer@gmail.com>
2018-05-31 07:36:06 -07:00

41 lines
1.4 KiB
Diff

From 5677e262d5b3f5ecc114f1aace4ffd77a7772282 Mon Sep 17 00:00:00 2001
From: Don Penney <don.penney@windriver.com>
Date: Tue, 21 Feb 2017 12:37:02 -0500
Subject: [PATCH] Update OCF to attempt connect in certain states
---
scripts/drbd.ocf | 17 +++++++++++++++--
1 file changed, 15 insertions(+), 2 deletions(-)
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf
index 0e26ea9..84332b0 100644
--- a/scripts/drbd.ocf
+++ b/scripts/drbd.ocf
@@ -415,8 +415,21 @@ drbd_condition() {
esac
;;
Outdated)
- rc=$OCF_DATA_OUTDATED
- ocf_log info "${OCF_RESKEY_drbd_resource} outdated"
+ case "${DRBD_CSTATE}" in
+ StandAlone)
+ rc=$OCF_DATA_STANDALONE
+ if [ $status -eq $OCF_SUCCESS ]
+ then
+ ocf_log info "${OCF_RESKEY_drbd_resource} outdated standalone, attempting to reconnect."
+ do_drbdadm -- --discard-my-data connect ${OCF_RESKEY_drbd_resource}
+ else
+ ocf_log info "${OCF_RESKEY_drbd_resource} outdated"
+ fi
+ ;;
+ *)
+ rc=$OCF_DATA_OUTDATED
+ ocf_log info "${OCF_RESKEY_drbd_resource} outdated"
+ esac
;;
Inconsistent)
case "${DRBD_CSTATE}" in
--
1.8.3.1