import sbd-1.4.2-2.el8

This commit is contained in:
CentOS Sources 2021-03-30 06:44:20 -04:00 committed by Stepan Oksanichenko
parent a5ce0a65c2
commit 15d34d1a00
7 changed files with 86 additions and 1627 deletions

2
.gitignore vendored
View File

@ -1 +1 @@
SOURCES/sbd-25fce8a7d5e8cd5abc2379077381b10bd6cec183.tar.gz
SOURCES/sbd-bfeee963f7363720da91a018045ca6746d822ba0.tar.gz

View File

@ -1 +1 @@
4b2d6feee6235758e2e3000bcad71ff059246b13 SOURCES/sbd-25fce8a7d5e8cd5abc2379077381b10bd6cec183.tar.gz
e68c21479e24b1660731125391ed8473e361bb95 SOURCES/sbd-bfeee963f7363720da91a018045ca6746d822ba0.tar.gz

View File

@ -0,0 +1,36 @@
From 542bf70c701083df032eb22cf59f4027ee88e60f Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Thu, 28 Jan 2021 21:46:11 +0100
Subject: [PATCH] Doc: adapt description of startup/shutdown sync with
pacemaker
now that the default is configurable at compile-time
---
src/sbd.sysconfig.in | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/src/sbd.sysconfig.in b/src/sbd.sysconfig.in
index 15cd66a..f49d780 100644
--- a/src/sbd.sysconfig.in
+++ b/src/sbd.sysconfig.in
@@ -114,9 +114,14 @@ SBD_MOVE_TO_ROOT_CGROUP=auto
# On shutdown pacemakerd is going to wait in a state where it
# has cleanly shutdown resources till sbd fetches that state.
#
-# Default is 'no' to prevent pacemaker from waiting for a
-# ping that will never come when working together with an sbd
-# version that doesn't support the feature.
+# The default is set when building SBD and Pacemaker from source.
+# Going for 'no' is safer if it can't be assured that SBD and
+# Pacemaker installed do both support the synchronization feature.
+# When going with 'yes' - also using package dependencies to
+# assure SBD & Pacemaker both support the synchronization
+# feature and are assuming the same default - an SBD configuration
+# inherited via an upgrade doesn't have to be altered to still
+# benefit from the new feature.
#
SBD_SYNC_RESOURCE_STARTUP=@SBD_SYNC_RESOURCE_STARTUP_SYSCONFIG@
--
1.8.3.1

View File

@ -1,82 +0,0 @@
From 1d2a7b8d059d4f090b351b8decca0ddf274c82a0 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Wed, 20 Nov 2019 15:20:19 +0100
Subject: [PATCH] Fix: regressions.sh: make parameter passing consistent
---
tests/regressions.sh | 24 ++++++++++++------------
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/tests/regressions.sh b/tests/regressions.sh
index 6cfb303..7ab80be 100755
--- a/tests/regressions.sh
+++ b/tests/regressions.sh
@@ -32,7 +32,7 @@
: ${SBD_USE_DM:="yes"}
sbd() {
- LD_PRELOAD=${SBD_PRELOAD} SBD_WATCHDOG_TIMEOUT=5 SBD_DEVICE="${SBD_DEVICE}" SBD_PRELOAD_LOG=${SBD_PRELOAD_LOG} SBD_WATCHDOG_DEV=/dev/watchdog setsid ${SBD_BINARY} -p ${SBD_PIDFILE} $*
+ LD_PRELOAD=${SBD_PRELOAD} SBD_WATCHDOG_TIMEOUT=5 SBD_DEVICE="${SBD_DEVICE}" SBD_PRELOAD_LOG=${SBD_PRELOAD_LOG} SBD_WATCHDOG_DEV=/dev/watchdog setsid ${SBD_BINARY} -p ${SBD_PIDFILE} "$@"
}
sbd_wipe_disk() {
@@ -98,26 +98,26 @@ sbd_daemon_cleanup() {
pkill -TERM --pidfile ${SBD_PIDFILE} 2>/dev/null
sleep 5
pkill -KILL --pidfile ${SBD_PIDFILE} 2>/dev/null
- pkill -KILL --parent $(cat ${SBD_PIDFILE} 2>/dev/null) 2>/dev/null
+ pkill -KILL --parent "$(cat ${SBD_PIDFILE} 2>/dev/null)" 2>/dev/null
echo > ${SBD_PIDFILE}
}
_ok() {
- echo -- $@
- $@
+ echo "-- $*"
+ "$@"
rc=$?
if [ $rc -ne 0 ]; then
- echo "$@ failed with $rc"
+ echo "$* failed with $rc"
exit $rc
fi
}
_no() {
- echo -- $@
- $@
+ echo "-- $*"
+ "$@"
rc=$?
if [ $rc -eq 0 ]; then
- echo "$@ did NOT fail ($rc)"
+ echo "$* did NOT fail ($rc)"
exit $rc
fi
return 0
@@ -126,7 +126,7 @@ _no() {
_in_log() {
grep "$@" ${SBD_PRELOAD_LOG} >/dev/null
if [ $? -ne 0 ]; then
- echo "didn't find '$@' in log:"
+ echo "didn't find '$*' in log:"
cat ${SBD_PRELOAD_LOG}
sbd_daemon_cleanup
exit 1
@@ -227,10 +227,10 @@ test_stall_inquisitor() {
sbd_daemon_cleanup
sbd -d ${D[1]} -d ${D[2]} -d ${D[3]} -n test-1 watch
sleep 10
- _ok kill -0 $(cat ${SBD_PIDFILE})
- kill -STOP $(cat ${SBD_PIDFILE})
+ _ok kill -0 "$(cat ${SBD_PIDFILE})"
+ kill -STOP "$(cat ${SBD_PIDFILE})"
sleep 10
- kill -CONT $(cat ${SBD_PIDFILE}) 2>/dev/null
+ kill -CONT "$(cat ${SBD_PIDFILE})" 2>/dev/null
_in_log "watchdog fired"
}
--
1.8.3.1

File diff suppressed because it is too large Load Diff

View File

@ -1,71 +0,0 @@
From 3048119bf4a0ddb2da01d4ca827ae659a089b622 Mon Sep 17 00:00:00 2001
From: Klaus Wenninger <klaus.wenninger@aon.at>
Date: Wed, 24 Jun 2020 14:33:21 +0200
Subject: [PATCH] Fix: sbd-pacemaker: handle new no_quorum_demote
and be robust against unknown no-quorum-policies handling them
as would be done with no_quorum_suicide
---
configure.ac | 17 ++++++++++++++++-
src/sbd-pacemaker.c | 11 ++++++++++-
2 files changed, 26 insertions(+), 2 deletions(-)
diff --git a/configure.ac b/configure.ac
index 02e2678..3391c5f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -89,7 +89,22 @@ AC_CHECK_LIB(cib, cib_apply_patch_event, , missing="yes")
dnl pacemaker-2.0 removed support for corosync 1 cluster layer
AC_CHECK_DECLS([pcmk_cluster_classic_ais, pcmk_cluster_cman],,,
- [#include <pacemaker/crm/cluster.h>])
+ [#include <pacemaker/crm/cluster.h>])
+
+dnl check for additional no-quorum-policies
+dnl AC_TEST_NO_QUORUM_POLICY(POLICY)
+AC_DEFUN([AC_TEST_NO_QUORUM_POLICY],[
+ AC_MSG_CHECKING([whether enum pe_quorum_policy defines value $1])
+ AC_LANG_PUSH([C])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
+ [#include <pacemaker/crm/pengine/pe_types.h>],
+ [enum pe_quorum_policy policy = $1; return policy;])],
+ AC_DEFINE_UNQUOTED(m4_toupper(HAVE_ENUM_$1), 1,
+ [Does pe_types.h have $1 value in enum pe_quorum_policy?])
+ AC_MSG_RESULT([yes]), AC_MSG_RESULT([no]))
+ AC_LANG_POP([C])
+])
+AC_TEST_NO_QUORUM_POLICY(no_quorum_demote)
dnl check for new pe-API
AC_CHECK_FUNCS(pe_new_working_set)
diff --git a/src/sbd-pacemaker.c b/src/sbd-pacemaker.c
index 11e104d..6e53557 100644
--- a/src/sbd-pacemaker.c
+++ b/src/sbd-pacemaker.c
@@ -321,13 +321,22 @@ compute_status(pe_working_set_t * data_set)
case no_quorum_freeze:
set_servant_health(pcmk_health_transient, LOG_INFO, "Quorum lost: Freeze resources");
break;
+#if HAVE_ENUM_NO_QUORUM_DEMOTE
+ case no_quorum_demote:
+ set_servant_health(pcmk_health_transient, LOG_INFO,
+ "Quorum lost: Demote promotable resources and stop others");
+ break;
+#endif
case no_quorum_stop:
set_servant_health(pcmk_health_transient, LOG_INFO, "Quorum lost: Stop ALL resources");
break;
case no_quorum_ignore:
set_servant_health(pcmk_health_transient, LOG_INFO, "Quorum lost: Ignore");
break;
- case no_quorum_suicide:
+ default:
+ /* immediate reboot is the most excessive action we take
+ use for no_quorum_suicide and everything we don't know yet
+ */
set_servant_health(pcmk_health_unclean, LOG_INFO, "Quorum lost: Self-fence");
break;
}
--
1.8.3.1

View File

@ -15,22 +15,29 @@
# Please submit bugfixes or comments via http://bugs.opensuse.org/
#
%global commit 25fce8a7d5e8cd5abc2379077381b10bd6cec183
%global shortcommit %(c=%{commit}; echo ${c:0:7})
%global commit bfeee963f7363720da91a018045ca6746d822ba0
%global github_owner Clusterlabs
%global buildnum 5
%global buildnum 2
%ifarch s390x s390
# minimum timeout on LPAR diag288 watchdog is 15s
%global watchdog_timeout_default 15
%else
%global watchdog_timeout_default 5
%endif
%global sync_resource_startup_default yes
%global sync_resource_startup_sysconfig yes
Name: sbd
Summary: Storage-based death
License: GPLv2+
Group: System Environment/Daemons
Version: 1.4.1
Version: 1.4.2
Release: %{buildnum}%{?dist}
Url: https://github.com/%{github_owner}/%{name}
Source0: https://github.com/%{github_owner}/%{name}/archive/%{commit}/%{name}-%{commit}.tar.gz
Patch1: 0001-Fix-regressions.sh-make-parameter-passing-consistent.patch
Patch2: 0002-Doc-add-environment-section-to-man-page.patch
Patch3: 0003-Fix-sbd-pacemaker-handle-new-no_quorum_demote.patch
Patch1: 0001-Doc-adapt-description-of-startup-shutdown-sync.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildRequires: autoconf
BuildRequires: automake
@ -46,6 +53,7 @@ BuildRequires: pkgconfig
BuildRequires: systemd
BuildRequires: make
Conflicts: fence-agents-sbd < 4.2.1-38
Conflicts: pacemaker-libs < 2.0.5-4
%if 0%{?rhel} > 0
ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
@ -72,17 +80,15 @@ regression-testing sbd.
%prep
%autosetup -n %{name}-%{commit} -p1
%ifarch s390x s390
sed -i src/sbd.sysconfig -e "s/Default: 5/Default: 15/"
sed -i src/sbd.sysconfig -e "s/SBD_WATCHDOG_TIMEOUT=5/SBD_WATCHDOG_TIMEOUT=15/"
%endif
###########################################################
%build
./autogen.sh
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
%configure
%configure --with-watchdog-timeout-default=%{watchdog_timeout_default} \
--with-sync-resource-startup-default=%{sync_resource_startup_default} \
--with-sync-resource-startup-sysconfig=%{sync_resource_startup_sysconfig}
make %{?_smp_mflags}
###########################################################
@ -139,7 +145,8 @@ fi
%defattr(-,root,root)
%config(noreplace) %{_sysconfdir}/sysconfig/sbd
%{_sbindir}/sbd
#%{_datadir}/sbd
%{_datadir}/sbd
%{_datadir}/pkgconfig/sbd.pc
%exclude %{_datadir}/sbd/regressions.sh
%doc %{_mandir}/man8/sbd*
%if %{defined _unitdir}
@ -156,6 +163,34 @@ fi
%{_libdir}/libsbdtestbed*
%changelog
* Thu Jan 28 2021 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-2
- update SBD_SYNC_RESOURCE_STARTUP description for
configurable default
Resolves: rhbz#1915874
* Thu Dec 3 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.2-1
- rebase to upstream v1.4.2
- make sbd default to do pacemakerd-api handshake
- conflict with pacemaker-libs < 2.0.5-4 to assure pacemaker
is defaulting to pacemakerd-api handshake
Resolves: rhbz#1903730
Resolves: rhbz#1873135
* Thu Jul 30 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-7
- conflict with pacemaker-libs < 2.0.4-5 instead of requiring
a minimum pacemaker version
Resolves: rhbz#1861713
* Mon Jul 27 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-6
- match qdevice-sync_timeout against wd-timeout
- sync startup/shutdown via pacemakerd-api
Resolves: rhbz#1703128
Resolves: rhbz#1743726
* Wed Jun 24 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-5
- rebuild against pacemaker having new no_quorum_demote