From 4b52733a9a105119d7baa22c921314fe373f9c214016739530f0ddd1011168a0 Mon Sep 17 00:00:00 2001 From: nick wang Date: Thu, 4 Aug 2016 05:04:55 +0000 Subject: [PATCH] Accepting request 416853 from home:wanghaisu:branches:network:ha-clustering:Factory bsc#990834, remove the warning with experimental. OBS-URL: https://build.opensuse.org/request/show/416853 OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=27 --- drbd-utils.changes | 6 +++++ support-drbd9-ra.patch | 51 ++++++++++++++++++++++++------------------ 2 files changed, 35 insertions(+), 22 deletions(-) diff --git a/drbd-utils.changes b/drbd-utils.changes index 8464fe0..ba621ad 100644 --- a/drbd-utils.changes +++ b/drbd-utils.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Wed Aug 3 03:39:18 UTC 2016 - nwang@suse.com + +- bsc#990834, remove the warning with experimental. +- Add warning when using multiple nodes. + ------------------------------------------------------------------- Wed Jun 29 01:54:54 UTC 2016 - nwang@suse.com diff --git a/support-drbd9-ra.patch b/support-drbd9-ra.patch index bee9b1e..f9c89b3 100644 --- a/support-drbd9-ra.patch +++ b/support-drbd9-ra.patch @@ -1,8 +1,7 @@ -diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf -index 632e16e..91990fc 100755 ---- a/scripts/drbd.ocf -+++ b/scripts/drbd.ocf -@@ -328,6 +328,23 @@ remove_master_score() { +diff -Naur drbd-utils-8.9.6.orig/scripts/drbd.ocf drbd-utils-8.9.6/scripts/drbd.ocf +--- drbd-utils-8.9.6.orig/scripts/drbd.ocf 2016-08-03 11:01:39.334765566 +0800 ++++ drbd-utils-8.9.6/scripts/drbd.ocf 2016-08-03 11:31:40.801931986 +0800 +@@ -328,6 +328,23 @@ do_cmd ${HA_SBIN_DIR}/crm_master -l reboot -D } @@ -26,7 +25,7 @@ index 632e16e..91990fc 100755 _sh_status_process() { # _volume not present should not happen, # but may help make this agent work even if it talks to drbd 8.3. -@@ -335,11 +352,36 @@ _sh_status_process() { +@@ -335,11 +352,36 @@ # not-yet-created volumes are reported as -1 (( _volume >= 0 )) || _volume=$[1 << 16] DRBD_ROLE_LOCAL[$_volume]=${_role:-Unconfigured} @@ -66,7 +65,7 @@ index 632e16e..91990fc 100755 drbd_set_status_variables() { # drbdsetup sh-status prints these values to stdout, # and then prints _sh_status_process. -@@ -352,6 +394,15 @@ drbd_set_status_variables() { +@@ -352,6 +394,15 @@ local _resynced_percent local out @@ -82,7 +81,7 @@ index 632e16e..91990fc 100755 DRBD_ROLE_LOCAL=() DRBD_ROLE_REMOTE=() DRBD_CSTATE=() -@@ -369,16 +420,20 @@ drbd_set_status_variables() { +@@ -369,16 +420,20 @@ # if there was no output at all, or a weird output # make sure the status arrays won't be empty. [[ ${#DRBD_ROLE_LOCAL[@]} != 0 ]] || DRBD_ROLE_LOCAL=(Unconfigured) @@ -108,7 +107,7 @@ index 632e16e..91990fc 100755 : == DEBUG == DRBD_DSTATE_REMOTE == ${DRBD_DSTATE_REMOTE[@]} == } -@@ -414,6 +469,9 @@ maybe_outdate_self() +@@ -414,6 +469,9 @@ ocf_is_true $OCF_RESKEY_stop_outdates_secondary || return 1 local host stop_uname @@ -118,7 +117,7 @@ index 632e16e..91990fc 100755 # We ignore $OCF_RESKEY_CRM_meta_notify_promote_uname here # because: if demote and promote for a _stacked_ resource # (or a "floating" one, where DRBD sits on top of some SAN) -@@ -437,6 +495,29 @@ maybe_outdate_self() +@@ -437,6 +495,29 @@ return 1 done @@ -148,7 +147,7 @@ index 632e16e..91990fc 100755 # e.g. post/promote of some other peer. # Should not happen, fencing constraints should take care of that. # But in case it does, scream out loud. -@@ -993,6 +1074,7 @@ drbd_validate_all () { +@@ -993,6 +1074,7 @@ DRBDADM="drbdadm" DRBDSETUP="drbdsetup" DRBD_HAS_MULTI_VOLUME=false @@ -156,7 +155,7 @@ index 632e16e..91990fc 100755 # these will _exit_ if they don't find the binaries check_binary $DRBDADM -@@ -1015,18 +1097,23 @@ drbd_validate_all () { +@@ -1015,18 +1097,28 @@ modinfo -F version drbd | sed -ne 's/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1 \2 \3/p')) fi @@ -164,7 +163,6 @@ index 632e16e..91990fc 100755 + if (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )); then + DRBD_HAS_MULTI_VOLUME=true + DRBD_VERSION_9=true -+ ocf_log warn "RA for DRBD version 9 is in experiment, do not using multiple primaries in DRBD9.0" + elif (( $DRBD_KERNEL_VERSION_CODE >= 0x080400 )); then DRBD_HAS_MULTI_VOLUME=true - elif (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )) ; then @@ -179,27 +177,36 @@ index 632e16e..91990fc 100755 + if ! $DRBD_VERSION_9 ; then + meta_expect clone-max -le 2 + fi ++ ++ if [ ${OCF_RESKEY_CRM_meta_clone_max} -gt 2 ] ++ then ++ ocf_log warn "SUSE only supports two nodes, although it is technically feasible to use more than two." ++ fi ++ meta_expect clone-node-max = 1 meta_expect master-node-max = 1 + # With current DRBD-9.0 version more than two primaries at the same time is not support. meta_expect master-max -le 2 # Rather than returning $OCF_ERR_CONFIGURED, we sometimes return -@@ -1080,7 +1167,8 @@ drbd_validate_all () { +@@ -1080,7 +1172,12 @@ # DRBD_DEVICES will be a shell array! # FIXME we should double check that we explicitly restrict the set of # valid characters in device names... - if DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>/dev/null)); then + # In DRBD9, no matter stacked or not "$DRBDADM --stacked sh-dev $DRBD_RESOURCE" will return true -+ if ! $DRBD_VERSION_9 && DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>/dev/null)); then ++ if $DRBD_VERSION_9 && ! $($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>&1| ++ grep "not available in stacked" >/dev/null); then ++ DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>/dev/null)) ++ DRBDADM="$DRBDADM -S" ++ elif ! $DRBD_VERSION_9 && DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>/dev/null)); then # apparently a "stacked" resource. Remember for future DRBDADM calls. DRBDADM="$DRBDADM -S" elif DRBD_DEVICES=($($DRBDADM sh-dev $DRBD_RESOURCE 2>/dev/null)); then -diff --git a/user/v9/drbdsetup.c b/user/v9/drbdsetup.c -index 053b9d3..fba72e1 100644 ---- a/user/v9/drbdsetup.c -+++ b/user/v9/drbdsetup.c -@@ -251,6 +251,7 @@ static int del_resource_cmd(struct drbd_cmd *cm, int argc, char **argv); +diff -Naur drbd-utils-8.9.6.orig/user/v9/drbdsetup.c drbd-utils-8.9.6/user/v9/drbdsetup.c +--- drbd-utils-8.9.6.orig/user/v9/drbdsetup.c 2016-08-03 11:01:39.318765641 +0800 ++++ drbd-utils-8.9.6/user/v9/drbdsetup.c 2016-08-03 11:13:34.582378058 +0800 +@@ -251,6 +251,7 @@ static int show_cmd(struct drbd_cmd *cm, int argc, char **argv); static int status_cmd(struct drbd_cmd *cm, int argc, char **argv); static int role_cmd(struct drbd_cmd *cm, int argc, char **argv); @@ -207,7 +214,7 @@ index 053b9d3..fba72e1 100644 static int cstate_cmd(struct drbd_cmd *cm, int argc, char **argv); static int dstate_cmd(struct drbd_cmd *cm, int argc, char **argv); static int check_resize_cmd(struct drbd_cmd *cm, int argc, char **argv); -@@ -478,6 +479,9 @@ struct drbd_cmd commands[] = { +@@ -478,6 +479,9 @@ {"role", CTX_RESOURCE, 0, NO_PAYLOAD, role_cmd, .lockless = true, .summary = "Show the current role of a resource." }, @@ -217,7 +224,7 @@ index 053b9d3..fba72e1 100644 {"cstate", CTX_PEER_NODE, 0, NO_PAYLOAD, cstate_cmd, .lockless = true, .summary = "Show the current state of a connection." }, -@@ -2576,6 +2580,87 @@ static int role_cmd(struct drbd_cmd *cm, int argc, char **argv) +@@ -2576,6 +2580,87 @@ return 0; }