Accepting request 802615 from network:ha-clustering:Unstable

bsc#1171419, 9.13.0

OBS-URL: https://build.opensuse.org/request/show/802615
OBS-URL: https://build.opensuse.org/package/show/network:ha-clustering:Factory/drbd-utils?expand=0&rev=92
This commit is contained in:
nick wang 2020-05-11 13:40:11 +00:00 committed by Git OBS Bridge
parent 224d8a1f53
commit 6206fb92ef
6 changed files with 20 additions and 95 deletions

View File

@ -5,10 +5,10 @@
<param name="filename">drbd-utils</param>
<!--
build service using release drbd-utils atm.
<param name="version">9.12.0</param>
<param name="version">9.13.0</param>
Using release tarball instead of git since need buildtag.c/h
-->
<param name="versionformat">9.12.0+git.%h</param>
<param name="versionformat">9.13.0+git.%h</param>
<param name="revision">master</param>
</service>

View File

@ -1,86 +0,0 @@
commit fd2eec6eca91e3d4d24852b5bac4dd61f9854e67
Author: Lars Ellenberg <lars.ellenberg@linbit.com>
Date: Mon Mar 2 14:12:55 2020 +0100
crm-fence-peer: detect pacemaker 2 "promotable clones"
The sed-script to guess the pacemaker xml-id to be used in location
constraints from the DRBD resource name expected '<master' tags, but
with new pacemaker 2 xml, these are '<clone's, with "promotable=true"
set in the meta attributes.
Use the crm_feature_set version from the top level <cib/> tag
to decide between the two.
diff --git a/scripts/crm-fence-peer.9.sh b/scripts/crm-fence-peer.9.sh
index 94c32747..26b67b9e 100755
--- a/scripts/crm-fence-peer.9.sh
+++ b/scripts/crm-fence-peer.9.sh
@@ -197,15 +197,28 @@ fence_peer_init()
{
# we know which instance we are: $OCF_RESOURCE_INSTANCE.
# but we do not know the xml ID of the <master/> :(
+
+ # with Pacemaker 2, its "promotable clones" instead of the
+ # "master" (which was deemed a bad naming choice).
+ # detect older pacemaker by crm_feature_set < 3.1.0
+ local clone_or_master=clone
+ case $crm_feature_set in
+ 3.0.*|[012].*) : "pacemaker version < 2, master slave"
+ clone_or_master=master ;;
+ esac
+
# cibadmin -Ql --xpath \
# '//master[primitive[@type="drbd" and instance_attributes/nvpair[@name = "drbd_resource" and @value="r0"]]]/@id'
# but I'd have to pipe that through sed anyways, because @attribute
# xpath queries are not supported.
# and I'd be incompatible with older cibadmin not supporting --xpath.
- # be cool, sed it out:
+ # be cool, sed it out.
+ # I could be more strict about primitive class:provider:type,
+ # or double check that it is in fact a promotable="true" clone...
+ # But in the real world, this is good enough.
: ${master_id=$(set +x; echo "$cib_xml" |
- sed -ne '/<master /,/<\/master>/ {
- /<master / h;
+ sed -ne "/<$clone_or_master /,/<\\/$clone_or_master>/ {
+ /<$clone_or_master / h;"'
/<primitive/,/<\/primitive/ {
/<instance_attributes/,/<\/instance_attributes/ {
/<nvpair .*\bname="drbd_resource"/ {
diff --git a/scripts/crm-fence-peer.sh b/scripts/crm-fence-peer.sh
index 513773fe..b7b62cfd 100755
--- a/scripts/crm-fence-peer.sh
+++ b/scripts/crm-fence-peer.sh
@@ -51,15 +51,28 @@ fence_peer_init()
{
# we know which instance we are: $OCF_RESOURCE_INSTANCE.
# but we do not know the xml ID of the <master/> :(
+
+ # with Pacemaker 2, its "promotable clones" instead of the
+ # "master" (which was deemed a bad naming choice).
+ # detect older pacemaker by crm_feature_set < 3.1.0
+ local clone_or_master=clone
+ case $crm_feature_set in
+ 3.0.*|[012].*) : "pacemaker version < 2, master slave"
+ clone_or_master=master ;;
+ esac
+
# cibadmin -Ql --xpath \
# '//master[primitive[@type="drbd" and instance_attributes/nvpair[@name = "drbd_resource" and @value="r0"]]]/@id'
# but I'd have to pipe that through sed anyways, because @attribute
# xpath queries are not supported.
# and I'd be incompatible with older cibadmin not supporting --xpath.
- # be cool, sed it out:
+ # be cool, sed it out.
+ # I could be more strict about primitive class:provider:type,
+ # or double check that it is in fact a promotable="true" clone...
+ # But in the real world, this is good enough.
: ${master_id=$(set +x; echo "$cib_xml" |
- sed -ne '/<master /,/<\/master>/ {
- /<master / h;
+ sed -ne "/<$clone_or_master /,/<\\/$clone_or_master>/ {
+ /<$clone_or_master / h;"'
/<primitive/,/<\/primitive/ {
/<instance_attributes/,/<\/instance_attributes/ {
/<nvpair .*\bname="drbd_resource"/ {

View File

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:16a6d000aac7f746419839a2c2afcb71fa8779fe0b5898e967767791cb8f4bc7
size 1206497

3
drbd-utils-9.13.0.tar.gz Normal file
View File

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:9a21691374604cbfe0d732c688a72f9e4b46a502400a5a0065a25608233141b1
size 1209926

View File

@ -1,3 +1,16 @@
-------------------------------------------------------------------
Sat May 9 01:17:31 UTC 2020 - nick wang <nwang@suse.com>
- bsc#1171419, Update to 9.13.0
* crm-fence-peer{,.9}.sh: detect Pacemaker 2 promotable clones
* submodules: switch to https, which makes it easier to clone
if you are behind some weird company firewalls.
* drbd.service: start pacemaker before drbd-proxy
* windrbd: various new commands including create-resource-from-url,
set-syslog-ip, scan-partitions-for-minor, install-bus-device,
remove-bus-device
- Remove patch crm-fence-peer-pacemaker2.patch
-------------------------------------------------------------------
Tue Mar 10 09:10:40 UTC 2020 - nick wang <nwang@suse.com>

View File

@ -22,7 +22,7 @@
%bcond_without prebuiltman
Name: drbd-utils
Version: 9.12.0
Version: 9.13.0
Release: 0
Summary: Distributed Replicated Block Device
License: GPL-2.0-or-later
@ -36,7 +36,6 @@ Patch3: fence-after-pacemaker-down.patch
# PATCH-SUSE-FIX: Disable quorum in default configuration (bsc#1032142)
Patch4: 0001-Disable-quorum-in-default-configuration-bsc-1032142.patch
Patch5: move_fencing_from_disk_to_net_in_example.patch
Patch6: crm-fence-peer-pacemaker2.patch
Provides: drbd-bash-completion = %{version}
Provides: drbd-pacemaker = %{version}
@ -87,7 +86,6 @@ raid 1. It is a building block for setting up clusters.
%patch3 -p1
%patch4 -p1
%patch5 -p1
%patch6 -p1
%build
export WANT_DRBD_REPRODUCIBLE_BUILD=1