Accepting request 534177 from home:wanghaisu:branches:network:ha-clustering:Factory

bsc#1061147 and bsc#1061145

OBS-URL: https://build.opensuse.org/request/show/534177
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=49
This commit is contained in:
nick wang 2017-10-16 09:53:20 +00:00 committed by Git OBS Bridge
parent e822cc26bb
commit b6d693f8e5
4 changed files with 75 additions and 1 deletions

View File

@ -1,3 +1,11 @@
-------------------------------------------------------------------
Mon Oct 16 09:38:35 UTC 2017 - nwang@suse.com
- bsc#1061145, fencing is moved from disk secion to net
Add move_fencing_from_disk_to_net_in_example.patch
- bsc#1061147, skip running drbdadm sh-b-pri in drbd9
Add skip_sh-b-pri_in_v9.patch
-------------------------------------------------------------------
Fri Aug 25 06:45:36 UTC 2017 - nwang@suse.com

View File

@ -15,6 +15,7 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%bcond_without drbdmon
Name: drbd-utils
@ -35,6 +36,8 @@ Patch4: fix-segfault-up-stacked-resource.patch
Patch5: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch6: fix_call_khelper_with_stack.patch
Patch7: Update-block-drbd-script-to-support-xen.patch
Patch8: move_fencing_from_disk_to_net_in_example.patch
Patch9: skip_sh-b-pri_in_v9.patch
Provides: drbd-bash-completion = %{version}
Provides: drbd-pacemaker = %{version}
@ -64,7 +67,7 @@ BuildRequires: pkgconfig
BuildRequires: systemd
BuildRequires: udev
%if %{with drbdmon}
BuildRequires: gcc-c++
BuildRequires: gcc-c++
%endif
Provides: drbd-control
Provides: drbdsetup
@ -84,6 +87,8 @@ raid 1. It is a building block for setting up clusters.
%patch5 -p1
%patch6 -p1
%patch7 -p1
%patch8 -p1
%patch9 -p1
%build
./autogen.sh

View File

@ -0,0 +1,25 @@
diff -Naur drbd-utils-9.0.0.orig/scripts/global_common.conf drbd-utils-9.0.0/scripts/global_common.conf
--- drbd-utils-9.0.0.orig/scripts/global_common.conf 2017-10-16 17:02:55.715528259 +0800
+++ drbd-utils-9.0.0/scripts/global_common.conf 2017-10-16 17:07:49.755636558 +0800
@@ -47,10 +47,10 @@
}
disk {
- # size on-io-error fencing disk-barrier disk-flushes
+ # on-io-error disk-barrier disk-flushes
# disk-drain md-flushes resync-rate resync-after al-extents
- # c-plan-ahead c-delay-target c-fill-target c-max-rate
- # c-min-rate disk-timeout
+ # c-plan-ahead c-delay-target c-fill-target c-max-rate
+ # c-min-rate disk-timeout
}
net {
@@ -60,6 +60,6 @@
# after-sb-1pri after-sb-2pri always-asbp rr-conflict
# ping-timeout data-integrity-alg tcp-cork on-congestion
# congestion-fill congestion-extents csums-alg verify-alg
- # use-rle
+ # use-rle fencing
}
}

36
skip_sh-b-pri_in_v9.patch Normal file
View File

@ -0,0 +1,36 @@
diff -Naur drbd-utils-9.0.0.orig/scripts/drbd drbd-utils-9.0.0/scripts/drbd
--- drbd-utils-9.0.0.orig/scripts/drbd 2017-10-16 17:02:55.707528280 +0800
+++ drbd-utils-9.0.0/scripts/drbd 2017-10-16 17:34:02.134427141 +0800
@@ -55,6 +55,13 @@
. /lib/lsb/init-functions
fi
+local DRBD_VERSION DRBD_IS_V9=false
+DRBD_VERSION="$($DRBDADM --version 2>/dev/null | grep DRBD_KERNEL_VERSION_CODE | cut -d '=' -f 2)"
+if (( $DRBD_VERSION >= 0x090000 ))
+then
+ DRBD_IS_V9=true
+fi
+
assure_module_is_loaded()
{
[ -e "$PROC_DRBD" ] && return
@@ -191,7 +198,8 @@
# Become primary if configured
# Currently, this is necessary for drbd8
# drbd9 supports automatic promote and removes the "sh-b-pri" command.
- $DRBDADM sh-b-pri all || true
+ # Do not run "$DRBDADM sh-b-pri all" in v8
+ $DRBD_IS_V9 || $DRBDADM sh-b-pri all || true
log_end_msg 0
# Now handle stacked devices, if any
@@ -218,7 +226,7 @@
done
done
$DRBDADM -S wait-con-int # User interruptible version of wait-connect all
- $DRBDADM -S sh-b-pri all || true
+ $DRBD_IS_V9 || $DRBDADM -S sh-b-pri all || true
log_end_msg 0
fi
fi