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
This commit is contained in:
nick wang 2016-08-04 05:04:55 +00:00 committed by Git OBS Bridge
parent 74fda436b1
commit 4b52733a9a
2 changed files with 35 additions and 22 deletions

View File

@ -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 Wed Jun 29 01:54:54 UTC 2016 - nwang@suse.com

View File

@ -1,8 +1,7 @@
diff --git a/scripts/drbd.ocf b/scripts/drbd.ocf diff -Naur drbd-utils-8.9.6.orig/scripts/drbd.ocf drbd-utils-8.9.6/scripts/drbd.ocf
index 632e16e..91990fc 100755 --- drbd-utils-8.9.6.orig/scripts/drbd.ocf 2016-08-03 11:01:39.334765566 +0800
--- a/scripts/drbd.ocf +++ drbd-utils-8.9.6/scripts/drbd.ocf 2016-08-03 11:31:40.801931986 +0800
+++ b/scripts/drbd.ocf @@ -328,6 +328,23 @@
@@ -328,6 +328,23 @@ remove_master_score() {
do_cmd ${HA_SBIN_DIR}/crm_master -l reboot -D do_cmd ${HA_SBIN_DIR}/crm_master -l reboot -D
} }
@ -26,7 +25,7 @@ index 632e16e..91990fc 100755
_sh_status_process() { _sh_status_process() {
# _volume not present should not happen, # _volume not present should not happen,
# but may help make this agent work even if it talks to drbd 8.3. # 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 # not-yet-created volumes are reported as -1
(( _volume >= 0 )) || _volume=$[1 << 16] (( _volume >= 0 )) || _volume=$[1 << 16]
DRBD_ROLE_LOCAL[$_volume]=${_role:-Unconfigured} DRBD_ROLE_LOCAL[$_volume]=${_role:-Unconfigured}
@ -66,7 +65,7 @@ index 632e16e..91990fc 100755
drbd_set_status_variables() { drbd_set_status_variables() {
# drbdsetup sh-status prints these values to stdout, # drbdsetup sh-status prints these values to stdout,
# and then prints _sh_status_process. # and then prints _sh_status_process.
@@ -352,6 +394,15 @@ drbd_set_status_variables() { @@ -352,6 +394,15 @@
local _resynced_percent local _resynced_percent
local out local out
@ -82,7 +81,7 @@ index 632e16e..91990fc 100755
DRBD_ROLE_LOCAL=() DRBD_ROLE_LOCAL=()
DRBD_ROLE_REMOTE=() DRBD_ROLE_REMOTE=()
DRBD_CSTATE=() 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 # if there was no output at all, or a weird output
# make sure the status arrays won't be empty. # make sure the status arrays won't be empty.
[[ ${#DRBD_ROLE_LOCAL[@]} != 0 ]] || DRBD_ROLE_LOCAL=(Unconfigured) [[ ${#DRBD_ROLE_LOCAL[@]} != 0 ]] || DRBD_ROLE_LOCAL=(Unconfigured)
@ -108,7 +107,7 @@ index 632e16e..91990fc 100755
: == DEBUG == DRBD_DSTATE_REMOTE == ${DRBD_DSTATE_REMOTE[@]} == : == 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 ocf_is_true $OCF_RESKEY_stop_outdates_secondary || return 1
local host stop_uname local host stop_uname
@ -118,7 +117,7 @@ index 632e16e..91990fc 100755
# We ignore $OCF_RESKEY_CRM_meta_notify_promote_uname here # We ignore $OCF_RESKEY_CRM_meta_notify_promote_uname here
# because: if demote and promote for a _stacked_ resource # because: if demote and promote for a _stacked_ resource
# (or a "floating" one, where DRBD sits on top of some SAN) # (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 return 1
done done
@ -148,7 +147,7 @@ index 632e16e..91990fc 100755
# e.g. post/promote of some other peer. # e.g. post/promote of some other peer.
# Should not happen, fencing constraints should take care of that. # Should not happen, fencing constraints should take care of that.
# But in case it does, scream out loud. # But in case it does, scream out loud.
@@ -993,6 +1074,7 @@ drbd_validate_all () { @@ -993,6 +1074,7 @@
DRBDADM="drbdadm" DRBDADM="drbdadm"
DRBDSETUP="drbdsetup" DRBDSETUP="drbdsetup"
DRBD_HAS_MULTI_VOLUME=false DRBD_HAS_MULTI_VOLUME=false
@ -156,7 +155,7 @@ index 632e16e..91990fc 100755
# these will _exit_ if they don't find the binaries # these will _exit_ if they don't find the binaries
check_binary $DRBDADM check_binary $DRBDADM
@@ -1015,18 +1097,23 @@ drbd_validate_all () { @@ -1015,18 +1097,28 @@
modinfo -F version drbd | modinfo -F version drbd |
sed -ne 's/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1 \2 \3/p')) sed -ne 's/^\([0-9]\+\)\.\([0-9]\+\)\.\([0-9]\+\).*$/\1 \2 \3/p'))
fi fi
@ -164,7 +163,6 @@ index 632e16e..91990fc 100755
+ if (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )); then + if (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )); then
+ DRBD_HAS_MULTI_VOLUME=true + DRBD_HAS_MULTI_VOLUME=true
+ DRBD_VERSION_9=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 + elif (( $DRBD_KERNEL_VERSION_CODE >= 0x080400 )); then
DRBD_HAS_MULTI_VOLUME=true DRBD_HAS_MULTI_VOLUME=true
- elif (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )) ; then - elif (( $DRBD_KERNEL_VERSION_CODE >= 0x090000 )) ; then
@ -179,27 +177,36 @@ index 632e16e..91990fc 100755
+ if ! $DRBD_VERSION_9 ; then + if ! $DRBD_VERSION_9 ; then
+ meta_expect clone-max -le 2 + meta_expect clone-max -le 2
+ fi + 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 clone-node-max = 1
meta_expect master-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. + # With current DRBD-9.0 version more than two primaries at the same time is not support.
meta_expect master-max -le 2 meta_expect master-max -le 2
# Rather than returning $OCF_ERR_CONFIGURED, we sometimes return # 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! # DRBD_DEVICES will be a shell array!
# FIXME we should double check that we explicitly restrict the set of # FIXME we should double check that we explicitly restrict the set of
# valid characters in device names... # valid characters in device names...
- if DRBD_DEVICES=($($DRBDADM --stacked sh-dev $DRBD_RESOURCE 2>/dev/null)); then - 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 + # 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. # apparently a "stacked" resource. Remember for future DRBDADM calls.
DRBDADM="$DRBDADM -S" DRBDADM="$DRBDADM -S"
elif DRBD_DEVICES=($($DRBDADM sh-dev $DRBD_RESOURCE 2>/dev/null)); then elif DRBD_DEVICES=($($DRBDADM sh-dev $DRBD_RESOURCE 2>/dev/null)); then
diff --git a/user/v9/drbdsetup.c b/user/v9/drbdsetup.c diff -Naur drbd-utils-8.9.6.orig/user/v9/drbdsetup.c drbd-utils-8.9.6/user/v9/drbdsetup.c
index 053b9d3..fba72e1 100644 --- drbd-utils-8.9.6.orig/user/v9/drbdsetup.c 2016-08-03 11:01:39.318765641 +0800
--- a/user/v9/drbdsetup.c +++ drbd-utils-8.9.6/user/v9/drbdsetup.c 2016-08-03 11:13:34.582378058 +0800
+++ b/user/v9/drbdsetup.c @@ -251,6 +251,7 @@
@@ -251,6 +251,7 @@ static int del_resource_cmd(struct drbd_cmd *cm, int argc, char **argv);
static int show_cmd(struct drbd_cmd *cm, int argc, char **argv); 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 status_cmd(struct drbd_cmd *cm, int argc, char **argv);
static int role_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 cstate_cmd(struct drbd_cmd *cm, int argc, char **argv);
static int dstate_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); 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, {"role", CTX_RESOURCE, 0, NO_PAYLOAD, role_cmd,
.lockless = true, .lockless = true,
.summary = "Show the current role of a resource." }, .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, {"cstate", CTX_PEER_NODE, 0, NO_PAYLOAD, cstate_cmd,
.lockless = true, .lockless = true,
.summary = "Show the current state of a connection." }, .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; return 0;
} }