import sbd-1.4.1-6.el8
This commit is contained in:
commit
1548ce39a3
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
||||
SOURCES/sbd-25fce8a7d5e8cd5abc2379077381b10bd6cec183.tar.gz
|
1
.sbd.metadata
Normal file
1
.sbd.metadata
Normal file
@ -0,0 +1 @@
|
||||
4b2d6feee6235758e2e3000bcad71ff059246b13 SOURCES/sbd-25fce8a7d5e8cd5abc2379077381b10bd6cec183.tar.gz
|
@ -0,0 +1,82 @@
|
||||
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
|
||||
|
1459
SOURCES/0002-Doc-add-environment-section-to-man-page.patch
Normal file
1459
SOURCES/0002-Doc-add-environment-section-to-man-page.patch
Normal file
File diff suppressed because it is too large
Load Diff
@ -0,0 +1,71 @@
|
||||
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
|
||||
|
@ -0,0 +1,399 @@
|
||||
From 4c3e4049b08799094a64dac289a48deef4d3d916 Mon Sep 17 00:00:00 2001
|
||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
||||
Date: Fri, 24 Jul 2020 14:31:01 +0200
|
||||
Subject: [PATCH] Fix: sbd-cluster: match qdevice-sync_timeout against
|
||||
wd-timeout
|
||||
|
||||
---
|
||||
configure.ac | 13 +++
|
||||
src/sbd-cluster.c | 252 +++++++++++++++++++++++++++++++++++++++++++++---------
|
||||
2 files changed, 223 insertions(+), 42 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 3391c5f..23547cf 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -109,6 +109,12 @@ AC_TEST_NO_QUORUM_POLICY(no_quorum_demote)
|
||||
dnl check for new pe-API
|
||||
AC_CHECK_FUNCS(pe_new_working_set)
|
||||
|
||||
+dnl check if votequorum comes with default for qdevice-sync_timeout
|
||||
+AC_CHECK_DECLS([VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT],
|
||||
+ HAVE_DECL_VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT=1,
|
||||
+ HAVE_DECL_VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT=0,
|
||||
+ [#include <corosync/votequorum.h>])
|
||||
+
|
||||
if test "$missing" = "yes"; then
|
||||
AC_MSG_ERROR([Missing required libraries or functions.])
|
||||
fi
|
||||
@@ -140,6 +146,13 @@ AM_CONDITIONAL(CHECK_TWO_NODE, test "$HAVE_cmap" = "1")
|
||||
AC_DEFINE_UNQUOTED(CHECK_VOTEQUORUM_HANDLE, $HAVE_votequorum, Turn on periodic checking of votequorum-handle)
|
||||
AM_CONDITIONAL(CHECK_VOTEQUORUM_HANDLE, test "$HAVE_votequorum" = "1")
|
||||
|
||||
+AC_DEFINE_UNQUOTED(CHECK_QDEVICE_SYNC_TIMEOUT,
|
||||
+ ($HAVE_DECL_VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT && $HAVE_cmap),
|
||||
+ Turn on checking if watchdog-timeout and qdevice-sync_timeout are matching)
|
||||
+AM_CONDITIONAL(CHECK_QDEVICE_SYNC_TIMEOUT,
|
||||
+ test "$HAVE_DECL_VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT" = "1" &&
|
||||
+ test "$HAVE_cmap" = "1")
|
||||
+
|
||||
CONFIGDIR=""
|
||||
AC_ARG_WITH(configdir,
|
||||
[ --with-configdir=DIR
|
||||
diff --git a/src/sbd-cluster.c b/src/sbd-cluster.c
|
||||
index 13fa580..b6c5512 100644
|
||||
--- a/src/sbd-cluster.c
|
||||
+++ b/src/sbd-cluster.c
|
||||
@@ -33,7 +33,7 @@
|
||||
#include <crm/cluster.h>
|
||||
#include <crm/common/mainloop.h>
|
||||
|
||||
-#if CHECK_TWO_NODE
|
||||
+#if CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
#include <glib-unix.h>
|
||||
#endif
|
||||
|
||||
@@ -86,11 +86,20 @@ sbd_plugin_membership_dispatch(cpg_handle_t handle,
|
||||
static votequorum_handle_t votequorum_handle = 0;
|
||||
#endif
|
||||
|
||||
+#if CHECK_TWO_NODE
|
||||
static bool two_node = false;
|
||||
+#endif
|
||||
static bool ever_seen_both = false;
|
||||
static int cpg_membership_entries = -1;
|
||||
|
||||
-#if CHECK_TWO_NODE
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+#include <corosync/votequorum.h>
|
||||
+static bool using_qdevice = false;
|
||||
+static uint32_t qdevice_sync_timeout = /* in seconds */
|
||||
+ VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT / 1000;
|
||||
+#endif
|
||||
+
|
||||
+#if CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
#include <corosync/cmap.h>
|
||||
|
||||
static cmap_handle_t cmap_handle = 0;
|
||||
@@ -102,28 +111,59 @@ void
|
||||
sbd_cpg_membership_health_update()
|
||||
{
|
||||
if(cpg_membership_entries > 0) {
|
||||
- bool quorum_is_suspect =
|
||||
+#if CHECK_TWO_NODE
|
||||
+ bool quorum_is_suspect_two_node =
|
||||
(two_node && ever_seen_both && cpg_membership_entries == 1);
|
||||
+#endif
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ bool quorum_is_suspect_qdevice_timing =
|
||||
+ using_qdevice && (qdevice_sync_timeout > timeout_watchdog);
|
||||
+#endif
|
||||
|
||||
- if (!quorum_is_suspect) {
|
||||
+ do {
|
||||
+#if CHECK_TWO_NODE
|
||||
+ if (quorum_is_suspect_two_node) {
|
||||
+ /* Alternative would be asking votequorum for number of votes.
|
||||
+ * Using pacemaker's cpg as source for number of active nodes
|
||||
+ * avoids binding to an additional library, is definitely
|
||||
+ * less code to write and we wouldn't have to combine data
|
||||
+ * from 3 sources (cmap, cpg & votequorum) in a potentially
|
||||
+ * racy environment.
|
||||
+ */
|
||||
+ set_servant_health(pcmk_health_noquorum, LOG_WARNING,
|
||||
+ "Connected to %s but requires both nodes present",
|
||||
+ name_for_cluster_type(get_cluster_type())
|
||||
+ );
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (quorum_is_suspect_qdevice_timing) {
|
||||
+ /* We can't really trust quorum info as qdevice-sync_timeout
|
||||
+ * makes reaction of quorum too sluggish for our
|
||||
+ * watchdog-timeout.
|
||||
+ */
|
||||
+ set_servant_health(pcmk_health_noquorum, LOG_WARNING,
|
||||
+ "Connected to %s but quorum using qdevice is distrusted "
|
||||
+ "for SBD as qdevice-sync_timeout (%ds) > watchdog-timeout "
|
||||
+ "(%lus).",
|
||||
+ name_for_cluster_type(get_cluster_type()),
|
||||
+ qdevice_sync_timeout, timeout_watchdog
|
||||
+ );
|
||||
+ break;
|
||||
+ }
|
||||
+#endif
|
||||
set_servant_health(pcmk_health_online, LOG_INFO,
|
||||
- "Connected to %s (%u members)",
|
||||
- name_for_cluster_type(get_cluster_type()),
|
||||
- cpg_membership_entries
|
||||
- );
|
||||
- } else {
|
||||
- /* Alternative would be asking votequorum for number of votes.
|
||||
- * Using pacemaker's cpg as source for number of active nodes
|
||||
- * avoids binding to an additional library, is definitely
|
||||
- * less code to write and we wouldn't have to combine data
|
||||
- * from 3 sources (cmap, cpq & votequorum) in a potentially
|
||||
- * racy environment.
|
||||
- */
|
||||
- set_servant_health(pcmk_health_noquorum, LOG_WARNING,
|
||||
- "Connected to %s but requires both nodes present",
|
||||
- name_for_cluster_type(get_cluster_type())
|
||||
- );
|
||||
- }
|
||||
+ "Connected to %s (%u members)%s",
|
||||
+ name_for_cluster_type(get_cluster_type()),
|
||||
+ cpg_membership_entries,
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ using_qdevice?" using qdevice for quorum":""
|
||||
+#else
|
||||
+ ""
|
||||
+#endif
|
||||
+ );
|
||||
+ } while (false);
|
||||
|
||||
if (cpg_membership_entries > 1) {
|
||||
ever_seen_both = true;
|
||||
@@ -146,7 +186,7 @@ sbd_cpg_membership_dispatch(cpg_handle_t handle,
|
||||
notify_parent();
|
||||
}
|
||||
|
||||
-#if CHECK_TWO_NODE
|
||||
+#if CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
static void sbd_cmap_notify_fn(
|
||||
cmap_handle_t cmap_handle,
|
||||
cmap_track_handle_t cmap_track_handle,
|
||||
@@ -156,21 +196,99 @@ static void sbd_cmap_notify_fn(
|
||||
struct cmap_notify_value old_val,
|
||||
void *user_data)
|
||||
{
|
||||
- if (new_val.type == CMAP_VALUETYPE_UINT8) {
|
||||
- switch (event) {
|
||||
- case CMAP_TRACK_ADD:
|
||||
- case CMAP_TRACK_MODIFY:
|
||||
- two_node = *((uint8_t *) new_val.data);
|
||||
- break;
|
||||
- case CMAP_TRACK_DELETE:
|
||||
- two_node = false;
|
||||
- break;
|
||||
- default:
|
||||
- return;
|
||||
- }
|
||||
- sbd_cpg_membership_health_update();
|
||||
- notify_parent();
|
||||
+ switch (event) {
|
||||
+ case CMAP_TRACK_ADD:
|
||||
+ case CMAP_TRACK_MODIFY:
|
||||
+ switch (new_val.type) {
|
||||
+ case CMAP_VALUETYPE_UINT8:
|
||||
+#if CHECK_TWO_NODE
|
||||
+ if (!strcmp(key_name, "quorum.two_node")) {
|
||||
+ two_node = *((uint8_t *) new_val.data);
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ case CMAP_VALUETYPE_STRING:
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (!strcmp(key_name, "quorum.device.model")) {
|
||||
+ using_qdevice =
|
||||
+ ((new_val.data) && strlen((char *) new_val.data));
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ case CMAP_VALUETYPE_UINT32:
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (!strcmp(key_name, "quorum.device.sync_timeout")) {
|
||||
+ if (new_val.data) {
|
||||
+ qdevice_sync_timeout =
|
||||
+ *((uint32_t *) new_val.data) / 1000;
|
||||
+ } else {
|
||||
+ qdevice_sync_timeout =
|
||||
+ VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT / 1000;
|
||||
+ }
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ default:
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+ case CMAP_TRACK_DELETE:
|
||||
+ switch (new_val.type) {
|
||||
+ case CMAP_VALUETYPE_UINT8:
|
||||
+#if CHECK_TWO_NODE
|
||||
+ if (!strcmp(key_name, "quorum.two_node")) {
|
||||
+ two_node = false;
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ case CMAP_VALUETYPE_STRING:
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (!strcmp(key_name, "quorum.device.model")) {
|
||||
+ using_qdevice = false;
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ case CMAP_VALUETYPE_UINT32:
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (!strcmp(key_name, "quorum.device.sync_timeout")) {
|
||||
+ qdevice_sync_timeout =
|
||||
+ VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT / 1000;
|
||||
+ } else {
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+#else
|
||||
+ return;
|
||||
+#endif
|
||||
+ default:
|
||||
+ return;
|
||||
+ }
|
||||
+ break;
|
||||
+ default:
|
||||
+ return;
|
||||
}
|
||||
+ sbd_cpg_membership_health_update();
|
||||
+ notify_parent();
|
||||
}
|
||||
|
||||
static gboolean
|
||||
@@ -200,9 +318,14 @@ cmap_destroy(void)
|
||||
}
|
||||
|
||||
static gboolean
|
||||
-sbd_get_two_node(void)
|
||||
+verify_against_cmap_config(void)
|
||||
{
|
||||
+#if CHECK_TWO_NODE
|
||||
uint8_t two_node_u8 = 0;
|
||||
+#endif
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ char *qdevice_model = NULL;
|
||||
+#endif
|
||||
int cmap_fd;
|
||||
|
||||
if (!track_handle) {
|
||||
@@ -211,12 +334,31 @@ sbd_get_two_node(void)
|
||||
goto out;
|
||||
}
|
||||
|
||||
+#if CHECK_TWO_NODE
|
||||
if (cmap_track_add(cmap_handle, "quorum.two_node",
|
||||
CMAP_TRACK_DELETE|CMAP_TRACK_MODIFY|CMAP_TRACK_ADD,
|
||||
sbd_cmap_notify_fn, NULL, &track_handle) != CS_OK) {
|
||||
cl_log(LOG_WARNING, "Failed adding CMAP tracker for 2Node-mode\n");
|
||||
goto out;
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (cmap_track_add(cmap_handle, "quorum.device.model",
|
||||
+ CMAP_TRACK_DELETE|CMAP_TRACK_MODIFY|CMAP_TRACK_ADD,
|
||||
+ sbd_cmap_notify_fn, NULL, &track_handle) != CS_OK) {
|
||||
+ cl_log(LOG_WARNING, "Failed adding CMAP tracker for qdevice-model\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+
|
||||
+ if (cmap_track_add(cmap_handle, "quorum.device.sync_timeout",
|
||||
+ CMAP_TRACK_DELETE|CMAP_TRACK_MODIFY|CMAP_TRACK_ADD,
|
||||
+ sbd_cmap_notify_fn, NULL, &track_handle) != CS_OK) {
|
||||
+ cl_log(LOG_WARNING,
|
||||
+ "Failed adding CMAP tracker for qdevice-sync_timeout\n");
|
||||
+ goto out;
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
/* add the tracker to mainloop */
|
||||
if (cmap_fd_get(cmap_handle, &cmap_fd) != CS_OK) {
|
||||
@@ -232,13 +374,39 @@ sbd_get_two_node(void)
|
||||
g_source_attach(cmap_source, NULL);
|
||||
}
|
||||
|
||||
- if (cmap_get_uint8(cmap_handle, "quorum.two_node", &two_node_u8) == CS_OK) {
|
||||
+#if CHECK_TWO_NODE
|
||||
+ if (cmap_get_uint8(cmap_handle, "quorum.two_node", &two_node_u8)
|
||||
+ == CS_OK) {
|
||||
cl_log(two_node_u8? LOG_NOTICE : LOG_INFO,
|
||||
"Corosync is%s in 2Node-mode", two_node_u8?"":" not");
|
||||
two_node = two_node_u8;
|
||||
} else {
|
||||
cl_log(LOG_INFO, "quorum.two_node not present in cmap\n");
|
||||
}
|
||||
+#endif
|
||||
+
|
||||
+#if CHECK_QDEVICE_SYNC_TIMEOUT
|
||||
+ if (cmap_get_string(cmap_handle, "quorum.device.model",
|
||||
+ &qdevice_model) == CS_OK) {
|
||||
+ using_qdevice = qdevice_model && strlen(qdevice_model);
|
||||
+ cl_log(using_qdevice? LOG_NOTICE : LOG_INFO,
|
||||
+ "Corosync is%s using qdevice", using_qdevice?"":" not");
|
||||
+ } else {
|
||||
+ cl_log(LOG_INFO, "quorum.device.model not present in cmap\n");
|
||||
+ }
|
||||
+
|
||||
+ if (cmap_get_uint32(cmap_handle, "quorum.device.sync_timeout",
|
||||
+ &qdevice_sync_timeout) == CS_OK) {
|
||||
+ qdevice_sync_timeout /= 1000;
|
||||
+ cl_log(LOG_INFO,
|
||||
+ "Corosync is using qdevice-sync_timeout=%ds",
|
||||
+ qdevice_sync_timeout);
|
||||
+ } else {
|
||||
+ cl_log(LOG_INFO,
|
||||
+ "quorum.device.sync_timeout not present in cmap\n");
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
return TRUE;
|
||||
|
||||
out:
|
||||
@@ -331,15 +499,15 @@ sbd_membership_connect(void)
|
||||
} else {
|
||||
cl_log(LOG_INFO, "Attempting connection to %s", name_for_cluster_type(stack));
|
||||
|
||||
-#if SUPPORT_COROSYNC && CHECK_TWO_NODE
|
||||
- if (sbd_get_two_node()) {
|
||||
+#if SUPPORT_COROSYNC && (CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT)
|
||||
+ if (verify_against_cmap_config()) {
|
||||
#endif
|
||||
|
||||
if(crm_cluster_connect(&cluster)) {
|
||||
connected = true;
|
||||
}
|
||||
|
||||
-#if SUPPORT_COROSYNC && CHECK_TWO_NODE
|
||||
+#if SUPPORT_COROSYNC && (CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT)
|
||||
}
|
||||
#endif
|
||||
}
|
||||
@@ -362,7 +530,7 @@ sbd_membership_destroy(gpointer user_data)
|
||||
cl_log(LOG_WARNING, "Lost connection to %s", name_for_cluster_type(get_cluster_type()));
|
||||
|
||||
if (get_cluster_type() != pcmk_cluster_unknown) {
|
||||
-#if SUPPORT_COROSYNC && CHECK_TWO_NODE
|
||||
+#if SUPPORT_COROSYNC && (CHECK_TWO_NODE || CHECK_QDEVICE_SYNC_TIMEOUT)
|
||||
cmap_destroy();
|
||||
#endif
|
||||
}
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,231 @@
|
||||
From 5b5ffac4cce861f3621267a73d2ad29f6d807335 Mon Sep 17 00:00:00 2001
|
||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
||||
Date: Tue, 10 Dec 2019 13:16:45 +0100
|
||||
Subject: [PATCH] Fix: sbd-pacemaker: sync with pacemakerd for robustness
|
||||
|
||||
State query ping of pacemakerd prevents pacemakerd from
|
||||
starting any sub-daemons (and thus services) if sbd can't
|
||||
reach it via ipc. As a health-check get timestamp from
|
||||
pacemakerd. On shudown fetch info about graceful
|
||||
shutdown from pacemakerd.
|
||||
Use new pacemakerd-api provided by pacemaker.
|
||||
---
|
||||
configure.ac | 4 ++
|
||||
src/sbd-pacemaker.c | 132 ++++++++++++++++++++++++++++++++++++++++++++++++----
|
||||
2 files changed, 126 insertions(+), 10 deletions(-)
|
||||
|
||||
diff --git a/configure.ac b/configure.ac
|
||||
index 23547cf..11d12f0 100644
|
||||
--- a/configure.ac
|
||||
+++ b/configure.ac
|
||||
@@ -81,6 +81,7 @@ AC_CHECK_LIB(crmcluster, crm_peer_init, , missing="yes")
|
||||
AC_CHECK_LIB(uuid, uuid_unparse, , missing="yes")
|
||||
AC_CHECK_LIB(cmap, cmap_initialize, , HAVE_cmap=0)
|
||||
AC_CHECK_LIB(votequorum, votequorum_getinfo, , HAVE_votequorum=0)
|
||||
+AC_CHECK_LIB(crmcommon, pcmk_pacemakerd_api_ping, HAVE_pacemakerd_api=1, HAVE_pacemakerd_api=0)
|
||||
|
||||
dnl pacemaker >= 1.1.8
|
||||
AC_CHECK_HEADERS(crm/cluster.h)
|
||||
@@ -153,6 +154,9 @@ AM_CONDITIONAL(CHECK_QDEVICE_SYNC_TIMEOUT,
|
||||
test "$HAVE_DECL_VOTEQUORUM_QDEVICE_DEFAULT_SYNC_TIMEOUT" = "1" &&
|
||||
test "$HAVE_cmap" = "1")
|
||||
|
||||
+AC_DEFINE_UNQUOTED(USE_PACEMAKERD_API, $HAVE_pacemakerd_api, Turn on synchronization between sbd & pacemakerd)
|
||||
+AM_CONDITIONAL(USE_PACEMAKERD_API, test "$HAVE_pacemakerd_api" = "1")
|
||||
+
|
||||
CONFIGDIR=""
|
||||
AC_ARG_WITH(configdir,
|
||||
[ --with-configdir=DIR
|
||||
diff --git a/src/sbd-pacemaker.c b/src/sbd-pacemaker.c
|
||||
index 6e53557..1243bfc 100644
|
||||
--- a/src/sbd-pacemaker.c
|
||||
+++ b/src/sbd-pacemaker.c
|
||||
@@ -83,6 +83,62 @@ pe_free_working_set(pe_working_set_t *data_set)
|
||||
|
||||
#endif
|
||||
|
||||
+static void clean_up(int rc);
|
||||
+
|
||||
+#if USE_PACEMAKERD_API
|
||||
+#include <crm/common/ipc_pacemakerd.h>
|
||||
+
|
||||
+static pcmk_ipc_api_t *pacemakerd_api = NULL;
|
||||
+static time_t last_ok = (time_t) 0;
|
||||
+
|
||||
+static void
|
||||
+pacemakerd_event_cb(pcmk_ipc_api_t *pacemakerd_api,
|
||||
+ enum pcmk_ipc_event event_type, crm_exit_t status,
|
||||
+ void *event_data, void *user_data)
|
||||
+{
|
||||
+ pcmk_pacemakerd_api_reply_t *reply = event_data;
|
||||
+
|
||||
+ switch (event_type) {
|
||||
+ case pcmk_ipc_event_disconnect:
|
||||
+ /* Unexpected */
|
||||
+ cl_log(LOG_ERR, "Lost connection to pacemakerd\n");
|
||||
+ return;
|
||||
+
|
||||
+ case pcmk_ipc_event_reply:
|
||||
+ break;
|
||||
+
|
||||
+ default:
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (status != CRM_EX_OK) {
|
||||
+ cl_log(LOG_ERR, "Bad reply from pacemakerd: %s",
|
||||
+ crm_exit_str(status));
|
||||
+ return;
|
||||
+ }
|
||||
+
|
||||
+ if (reply->reply_type != pcmk_pacemakerd_reply_ping) {
|
||||
+ cl_log(LOG_ERR, "Unknown reply type %d from pacemakerd\n",
|
||||
+ reply->reply_type);
|
||||
+ } else {
|
||||
+ if ((reply->data.ping.last_good != (time_t) 0) &&
|
||||
+ (reply->data.ping.status == pcmk_rc_ok)) {
|
||||
+ switch (reply->data.ping.state) {
|
||||
+ case pcmk_pacemakerd_state_running:
|
||||
+ case pcmk_pacemakerd_state_shutting_down:
|
||||
+ last_ok = reply->data.ping.last_good;
|
||||
+ break;
|
||||
+ case pcmk_pacemakerd_state_shutdown_complete:
|
||||
+ clean_up(EXIT_PCMK_SERVANT_GRACEFUL_SHUTDOWN);
|
||||
+ break;
|
||||
+ default:
|
||||
+ break;
|
||||
+ }
|
||||
+ }
|
||||
+ }
|
||||
+}
|
||||
+#endif
|
||||
+
|
||||
extern int disk_count;
|
||||
|
||||
static void clean_up(int rc);
|
||||
@@ -133,10 +189,13 @@ mon_cib_connection_destroy(gpointer user_data)
|
||||
cib->cmds->signoff(cib);
|
||||
/* retrigger as last one might have been skipped */
|
||||
mon_refresh_state(NULL);
|
||||
+
|
||||
+#if !USE_PACEMAKERD_API
|
||||
if (pcmk_clean_shutdown) {
|
||||
/* assume a graceful pacemaker-shutdown */
|
||||
clean_up(EXIT_PCMK_SERVANT_GRACEFUL_SHUTDOWN);
|
||||
}
|
||||
+#endif
|
||||
/* getting here we aren't sure about the pacemaker-state
|
||||
so try to use the timeout to reconnect and get
|
||||
everything sorted out again
|
||||
@@ -196,6 +255,13 @@ mon_timer_notify(gpointer data)
|
||||
g_source_remove(timer_id_notify);
|
||||
}
|
||||
|
||||
+#if USE_PACEMAKERD_API
|
||||
+ {
|
||||
+ time_t now = time(NULL);
|
||||
+
|
||||
+ if ((last_ok <= now) && (now - last_ok < timeout_watchdog)) {
|
||||
+#endif
|
||||
+
|
||||
if (cib_connected) {
|
||||
if (counter == counter_max) {
|
||||
mon_retrieve_current_cib();
|
||||
@@ -207,6 +273,16 @@ mon_timer_notify(gpointer data)
|
||||
counter++;
|
||||
}
|
||||
}
|
||||
+
|
||||
+#if USE_PACEMAKERD_API
|
||||
+ }
|
||||
+ }
|
||||
+ if (pcmk_connect_ipc(pacemakerd_api,
|
||||
+ pcmk_ipc_dispatch_main) == pcmk_rc_ok) {
|
||||
+ pcmk_pacemakerd_api_ping(pacemakerd_api, crm_system_name);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
timer_id_notify = g_timeout_add(timeout_loop * 1000, mon_timer_notify, NULL);
|
||||
return FALSE;
|
||||
}
|
||||
@@ -526,6 +602,14 @@ clean_up(int rc)
|
||||
cib = NULL;
|
||||
}
|
||||
|
||||
+#if USE_PACEMAKERD_API
|
||||
+ if (pacemakerd_api != NULL) {
|
||||
+ pcmk_ipc_api_t *capi = pacemakerd_api;
|
||||
+ pacemakerd_api = NULL; // Ensure we can't free this twice
|
||||
+ pcmk_free_ipc_api(capi);
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
if (rc >= 0) {
|
||||
exit(rc);
|
||||
}
|
||||
@@ -535,11 +619,11 @@ clean_up(int rc)
|
||||
int
|
||||
servant_pcmk(const char *diskname, int mode, const void* argp)
|
||||
{
|
||||
- int exit_code = 0;
|
||||
+ int exit_code = 0;
|
||||
|
||||
- crm_system_name = strdup("sbd:pcmk");
|
||||
- cl_log(LOG_NOTICE, "Monitoring Pacemaker health");
|
||||
- set_proc_title("sbd: watcher: Pacemaker");
|
||||
+ crm_system_name = strdup("sbd:pcmk");
|
||||
+ cl_log(LOG_NOTICE, "Monitoring Pacemaker health");
|
||||
+ set_proc_title("sbd: watcher: Pacemaker");
|
||||
setenv("PCMK_watchdog", "true", 1);
|
||||
|
||||
if(debug == 0) {
|
||||
@@ -548,12 +632,40 @@ servant_pcmk(const char *diskname, int mode, const void* argp)
|
||||
}
|
||||
|
||||
|
||||
- if (data_set == NULL) {
|
||||
- data_set = pe_new_working_set();
|
||||
- }
|
||||
- if (data_set == NULL) {
|
||||
- return -1;
|
||||
- }
|
||||
+ if (data_set == NULL) {
|
||||
+ data_set = pe_new_working_set();
|
||||
+ }
|
||||
+ if (data_set == NULL) {
|
||||
+ return -1;
|
||||
+ }
|
||||
+
|
||||
+#if USE_PACEMAKERD_API
|
||||
+ {
|
||||
+ int rc;
|
||||
+
|
||||
+ rc = pcmk_new_ipc_api(&pacemakerd_api, pcmk_ipc_pacemakerd);
|
||||
+ if (pacemakerd_api == NULL) {
|
||||
+ cl_log(LOG_ERR, "Could not connect to pacemakerd: %s\n",
|
||||
+ pcmk_rc_str(rc));
|
||||
+ return -1;
|
||||
+ }
|
||||
+ pcmk_register_ipc_callback(pacemakerd_api, pacemakerd_event_cb, NULL);
|
||||
+ do {
|
||||
+ rc = pcmk_connect_ipc(pacemakerd_api, pcmk_ipc_dispatch_main);
|
||||
+ if (rc != pcmk_rc_ok) {
|
||||
+ cl_log(LOG_DEBUG, "Could not connect to pacemakerd: %s\n",
|
||||
+ pcmk_rc_str(rc));
|
||||
+ sleep(reconnect_msec / 1000);
|
||||
+ }
|
||||
+ } while (rc != pcmk_rc_ok);
|
||||
+ /* send a ping to pacemakerd to wake it up */
|
||||
+ pcmk_pacemakerd_api_ping(pacemakerd_api, crm_system_name);
|
||||
+ /* cib should come up now as well so it's time
|
||||
+ * to have the inquisitor have a closer look
|
||||
+ */
|
||||
+ notify_parent();
|
||||
+ }
|
||||
+#endif
|
||||
|
||||
if (current_cib == NULL) {
|
||||
cib = cib_new();
|
||||
--
|
||||
1.8.3.1
|
||||
|
@ -0,0 +1,110 @@
|
||||
From f4d38a073ce3bfa2078792f1cc85229457430292 Mon Sep 17 00:00:00 2001
|
||||
From: Klaus Wenninger <klaus.wenninger@aon.at>
|
||||
Date: Tue, 21 Jul 2020 18:30:30 +0200
|
||||
Subject: [PATCH] Fix: make syncing of pacemaker resource startup configurable
|
||||
|
||||
---
|
||||
src/sbd-inquisitor.c | 20 ++++++++++++++++++++
|
||||
src/sbd-pacemaker.c | 6 +++---
|
||||
src/sbd.h | 1 +
|
||||
src/sbd.sysconfig | 14 ++++++++++++++
|
||||
4 files changed, 38 insertions(+), 3 deletions(-)
|
||||
|
||||
diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c
|
||||
index 52ede8a..962725e 100644
|
||||
--- a/src/sbd-inquisitor.c
|
||||
+++ b/src/sbd-inquisitor.c
|
||||
@@ -35,6 +35,7 @@ bool do_flush = true;
|
||||
char timeout_sysrq_char = 'b';
|
||||
bool move_to_root_cgroup = true;
|
||||
bool enforce_moving_to_root_cgroup = false;
|
||||
+bool sync_resource_startup = false;
|
||||
|
||||
int parse_device_line(const char *line);
|
||||
|
||||
@@ -964,6 +965,25 @@ int main(int argc, char **argv, char **envp)
|
||||
}
|
||||
}
|
||||
|
||||
+ value = getenv("SBD_SYNC_RESOURCE_STARTUP");
|
||||
+ if(value) {
|
||||
+ sync_resource_startup = crm_is_true(value);
|
||||
+ }
|
||||
+#if !USE_PACEMAKERD_API
|
||||
+ if (sync_resource_startup) {
|
||||
+ fprintf(stderr, "Failed to sync resource-startup as "
|
||||
+ "SBD was built against pacemaker not supporting pacemakerd-API.\n");
|
||||
+ exit_status = -1;
|
||||
+ goto out;
|
||||
+ }
|
||||
+#else
|
||||
+ if (!sync_resource_startup) {
|
||||
+ cl_log(LOG_WARNING, "SBD built against pacemaker supporting "
|
||||
+ "pacemakerd-API. Should think about enabling "
|
||||
+ "SBD_SYNC_RESOURCE_STARTUP.");
|
||||
+ }
|
||||
+#endif
|
||||
+
|
||||
while ((c = getopt(argc, argv, "czC:DPRTWZhvw:d:n:p:1:2:3:4:5:t:I:F:S:s:r:")) != -1) {
|
||||
switch (c) {
|
||||
case 'D':
|
||||
diff --git a/src/sbd-pacemaker.c b/src/sbd-pacemaker.c
|
||||
index 1243bfc..aa1fb57 100644
|
||||
--- a/src/sbd-pacemaker.c
|
||||
+++ b/src/sbd-pacemaker.c
|
||||
@@ -190,12 +190,12 @@ mon_cib_connection_destroy(gpointer user_data)
|
||||
/* retrigger as last one might have been skipped */
|
||||
mon_refresh_state(NULL);
|
||||
|
||||
-#if !USE_PACEMAKERD_API
|
||||
- if (pcmk_clean_shutdown) {
|
||||
+
|
||||
+ if ((pcmk_clean_shutdown) && (!sync_resource_startup)) {
|
||||
/* assume a graceful pacemaker-shutdown */
|
||||
clean_up(EXIT_PCMK_SERVANT_GRACEFUL_SHUTDOWN);
|
||||
}
|
||||
-#endif
|
||||
+
|
||||
/* getting here we aren't sure about the pacemaker-state
|
||||
so try to use the timeout to reconnect and get
|
||||
everything sorted out again
|
||||
diff --git a/src/sbd.h b/src/sbd.h
|
||||
index 382e553..3b6647c 100644
|
||||
--- a/src/sbd.h
|
||||
+++ b/src/sbd.h
|
||||
@@ -161,6 +161,7 @@ extern bool do_flush;
|
||||
extern char timeout_sysrq_char;
|
||||
extern bool move_to_root_cgroup;
|
||||
extern bool enforce_moving_to_root_cgroup;
|
||||
+extern bool sync_resource_startup;
|
||||
|
||||
/* Global, non-tunable variables: */
|
||||
extern int sector_size;
|
||||
diff --git a/src/sbd.sysconfig b/src/sbd.sysconfig
|
||||
index 33b50d0..b32e826 100644
|
||||
--- a/src/sbd.sysconfig
|
||||
+++ b/src/sbd.sysconfig
|
||||
@@ -106,6 +106,20 @@ SBD_TIMEOUT_ACTION=flush,reboot
|
||||
#
|
||||
SBD_MOVE_TO_ROOT_CGROUP=auto
|
||||
|
||||
+## Type: yesno
|
||||
+## Default: no
|
||||
+#
|
||||
+# If resource startup syncing is enabled then pacemakerd is
|
||||
+# gonna wait to be pinged via IPC before it starts resources.
|
||||
+# 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.
|
||||
+#
|
||||
+SBD_SYNC_RESOURCE_STARTUP=no
|
||||
+
|
||||
## Type: string
|
||||
## Default: ""
|
||||
#
|
||||
--
|
||||
1.8.3.1
|
||||
|
395
SPECS/sbd.spec
Normal file
395
SPECS/sbd.spec
Normal file
@ -0,0 +1,395 @@
|
||||
#
|
||||
# spec file for package sbd
|
||||
#
|
||||
# Copyright (c) 2014 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||
# Copyright (c) 2013 Lars Marowsky-Bree
|
||||
#
|
||||
# All modifications and additions to the file contributed by third parties
|
||||
# remain the property of their copyright owners, unless otherwise agreed
|
||||
# upon. The license for this file, and modifications and additions to the
|
||||
# file, is the same license as for the pristine package itself (unless the
|
||||
# license for the pristine package is not an Open Source License, in which
|
||||
# case the license is the MIT License). An "Open Source License" is a
|
||||
# license that conforms to the Open Source Definition (Version 1.9)
|
||||
# published by the Open Source Initiative.
|
||||
|
||||
# Please submit bugfixes or comments via http://bugs.opensuse.org/
|
||||
#
|
||||
%global commit 25fce8a7d5e8cd5abc2379077381b10bd6cec183
|
||||
%global shortcommit %(c=%{commit}; echo ${c:0:7})
|
||||
%global github_owner Clusterlabs
|
||||
%global buildnum 6
|
||||
|
||||
Name: sbd
|
||||
Summary: Storage-based death
|
||||
License: GPLv2+
|
||||
Group: System Environment/Daemons
|
||||
Version: 1.4.1
|
||||
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
|
||||
Patch4: 0004-Fix-sbd-cluster-match-qdevice-sync_timeout-against-w.patch
|
||||
Patch5: 0005-Fix-sbd-pacemaker-sync-with-pacemakerd-for-robustnes.patch
|
||||
Patch6: 0006-Fix-make-syncing-of-pacemaker-resource-startup-confi.patch
|
||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||
BuildRequires: autoconf
|
||||
BuildRequires: automake
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: glib2-devel
|
||||
BuildRequires: libaio-devel
|
||||
BuildRequires: corosync-devel
|
||||
BuildRequires: pacemaker-libs-devel > 1.1.12
|
||||
BuildRequires: libtool
|
||||
BuildRequires: libuuid-devel
|
||||
BuildRequires: libxml2-devel
|
||||
BuildRequires: pkgconfig
|
||||
BuildRequires: systemd
|
||||
BuildRequires: make
|
||||
Conflicts: fence-agents-sbd < 4.2.1-38
|
||||
Requires: pacemaker >= 2.0.4-5
|
||||
|
||||
%if 0%{?rhel} > 0
|
||||
ExclusiveArch: i686 x86_64 s390x ppc64le aarch64
|
||||
%endif
|
||||
|
||||
%if %{defined systemd_requires}
|
||||
%systemd_requires
|
||||
%endif
|
||||
|
||||
%description
|
||||
|
||||
This package contains the storage-based death functionality.
|
||||
|
||||
%package tests
|
||||
Summary: Storage-based death environment for regression tests
|
||||
License: GPLv2+
|
||||
Group: System Environment/Daemons
|
||||
|
||||
%description tests
|
||||
This package provides an environment + testscripts for
|
||||
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
|
||||
sed -i src/sbd.sysconfig -e "s/SBD_SYNC_RESOURCE_STARTUP=no/SBD_SYNC_RESOURCE_STARTUP=yes/"
|
||||
|
||||
###########################################################
|
||||
|
||||
%build
|
||||
./autogen.sh
|
||||
export CFLAGS="$RPM_OPT_FLAGS -Wall -Werror"
|
||||
%configure
|
||||
make %{?_smp_mflags}
|
||||
|
||||
###########################################################
|
||||
|
||||
%install
|
||||
|
||||
make DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} install
|
||||
rm -rf ${RPM_BUILD_ROOT}%{_libdir}/stonith
|
||||
|
||||
install -D -m 0755 tests/regressions.sh $RPM_BUILD_ROOT/usr/share/sbd/regressions.sh
|
||||
%if %{defined _unitdir}
|
||||
install -D -m 0644 src/sbd.service $RPM_BUILD_ROOT/%{_unitdir}/sbd.service
|
||||
install -D -m 0644 src/sbd_remote.service $RPM_BUILD_ROOT/%{_unitdir}/sbd_remote.service
|
||||
%endif
|
||||
|
||||
mkdir -p ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig
|
||||
install -m 644 src/sbd.sysconfig ${RPM_BUILD_ROOT}%{_sysconfdir}/sysconfig/sbd
|
||||
|
||||
# Don't package static libs
|
||||
find %{buildroot} -name '*.a' -type f -print0 | xargs -0 rm -f
|
||||
find %{buildroot} -name '*.la' -type f -print0 | xargs -0 rm -f
|
||||
|
||||
###########################################################
|
||||
|
||||
%clean
|
||||
rm -rf %{buildroot}
|
||||
|
||||
%if %{defined _unitdir}
|
||||
%post
|
||||
%systemd_post sbd.service
|
||||
%systemd_post sbd_remote.service
|
||||
if [ $1 -ne 1 ] ; then
|
||||
if systemctl --quiet is-enabled sbd.service 2>/dev/null
|
||||
then
|
||||
systemctl --quiet reenable sbd.service 2>/dev/null || :
|
||||
fi
|
||||
if systemctl --quiet is-enabled sbd_remote.service 2>/dev/null
|
||||
then
|
||||
systemctl --quiet reenable sbd_remote.service 2>/dev/null || :
|
||||
fi
|
||||
fi
|
||||
|
||||
%preun
|
||||
%systemd_preun sbd.service
|
||||
%systemd_preun sbd_remote.service
|
||||
|
||||
%postun
|
||||
%systemd_postun sbd.service
|
||||
%systemd_postun sbd_remote.service
|
||||
%endif
|
||||
|
||||
%files
|
||||
###########################################################
|
||||
%defattr(-,root,root)
|
||||
%config(noreplace) %{_sysconfdir}/sysconfig/sbd
|
||||
%{_sbindir}/sbd
|
||||
#%{_datadir}/sbd
|
||||
%exclude %{_datadir}/sbd/regressions.sh
|
||||
%doc %{_mandir}/man8/sbd*
|
||||
%if %{defined _unitdir}
|
||||
%{_unitdir}/sbd.service
|
||||
%{_unitdir}/sbd_remote.service
|
||||
%endif
|
||||
%doc COPYING
|
||||
|
||||
%files tests
|
||||
###########################################################
|
||||
%defattr(-,root,root)
|
||||
%dir %{_datadir}/sbd
|
||||
%{_datadir}/sbd/regressions.sh
|
||||
%{_libdir}/libsbdtestbed*
|
||||
|
||||
%changelog
|
||||
* 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
|
||||
|
||||
Resolves: rhbz#1850078
|
||||
|
||||
* Wed Jun 24 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-4
|
||||
- handle new no_quorum_demote in pacemaker
|
||||
|
||||
Resolves: rhbz#1850078
|
||||
|
||||
* Mon Feb 17 2020 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-3
|
||||
- append the man-page by a section auto-generated from
|
||||
sbd.sysconfig
|
||||
|
||||
Resolves: rhbz#1803826
|
||||
|
||||
* Wed Nov 20 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-2
|
||||
- silence coverity regarding inconsistent parameter passing
|
||||
- adapt fence-agents-dependency from upstream to distribution
|
||||
|
||||
Resolves: rhbz#1769305
|
||||
|
||||
* Tue Nov 19 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.1-1
|
||||
- rebase to upstream v1.4.0
|
||||
|
||||
Resolves: rhbz#1769305
|
||||
Resolves: rhbz#1768906
|
||||
|
||||
* Fri Aug 16 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-15
|
||||
- check for shutdown attribute on every cib-diff
|
||||
|
||||
Resolves: rhbz#1718296
|
||||
|
||||
* Wed Jun 12 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-10
|
||||
- added missing patches to git
|
||||
|
||||
Resolves: rhbz#1702727
|
||||
Resolves: rhbz#1718296
|
||||
|
||||
* Tue Jun 11 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-9
|
||||
- assume graceful pacemaker exit if leftovers are unmanaged
|
||||
- query corosync liveness via votequorum-api
|
||||
|
||||
Resolves: rhbz#1702727
|
||||
Resolves: rhbz#1718296
|
||||
|
||||
* Mon Jun 3 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-8
|
||||
- check for rt-budget > 0 and move to root-slice otherwise
|
||||
|
||||
Resolves: rhbz#1713021
|
||||
|
||||
* Wed Apr 10 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-7
|
||||
- add some minor fixes from upstream found by coverity
|
||||
|
||||
Resolves: rhbz#1698056
|
||||
|
||||
* Wed Apr 10 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-6
|
||||
- add decision-context to gating.yaml
|
||||
|
||||
Resolves: rhbz#1682137
|
||||
|
||||
* Mon Jan 14 2019 Klaus Wenninger <kwenning@redhat.com> - 1.4.0-5
|
||||
- rebase to upstream v1.4.0
|
||||
- finalize cmap connection if disconnected from cluster
|
||||
- make handling of cib-connection loss more robust
|
||||
- add ci test files
|
||||
- use generic term cluster-services in doc
|
||||
- stress in doc that on-disk metadata watchdog-timeout
|
||||
takes precedence
|
||||
- fail earlier on invalid servants to make gcc 9 happy
|
||||
|
||||
Resolves: rhbz#1698056
|
||||
Resolves: rhbz#1682137
|
||||
|
||||
* Mon Dec 17 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-18
|
||||
- make timeout-action executed by sbd configurable
|
||||
|
||||
Resolves: rhbz#1660147
|
||||
|
||||
* Mon Dec 3 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-17
|
||||
- use pacemaker's new pe api with constructors/destructors
|
||||
|
||||
Resolves: rhbz#1650663
|
||||
|
||||
* Wed Sep 19 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-16
|
||||
- avoid statting potential symlink-targets in /dev
|
||||
|
||||
Resolves: rhbz#1629020
|
||||
|
||||
* Wed Sep 19 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-15
|
||||
- rebuild against new versions of libqb (1.0.3-7.el8),
|
||||
corosync (2.99.3-4.el8) and pacemaker (2.0.0-9.el8)
|
||||
|
||||
Related: rhbz#1615945
|
||||
|
||||
* Fri Sep 14 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-14
|
||||
- skip symlinks pointing to dev-nodes outside of /dev
|
||||
|
||||
Resolves: rhbz#1629020
|
||||
|
||||
* Wed Sep 5 2018 Klaus Wenninger <kwenning@redhat.com> - 1.3.1-13
|
||||
- Require systemd-package during build to have the macros
|
||||
|
||||
Resolves: rhbz#1625553
|
||||
|
||||
* Mon Jul 30 2018 Florian Weimer <fweimer@redhat.com> - 1.3.1-12
|
||||
- Rebuild with fixed binutils
|
||||
|
||||
* Tue Jul 3 2018 <kwenning@redhat.com> - 1.3.1-11
|
||||
- replaced tarball by version downloaded from github
|
||||
|
||||
* Mon Jul 2 2018 <kwenning@redhat.com> - 1.3.1-10
|
||||
- removed unneeded python build-dependency
|
||||
- updated legacy corosync-devel to corosynclib-devel
|
||||
|
||||
Resolves: rhbz#1595856
|
||||
|
||||
* Fri May 4 2018 <kwenning@redhat.com> - 1.3.1-9
|
||||
- use cib-api directly as get_cib_copy gone with
|
||||
pacemaker 2.0.0
|
||||
- add sys/sysmacros.h to build with glibc-2.25
|
||||
- enlarge string buffer to satisfy newer gcc
|
||||
- no corosync 1 support with pacemaker 2.0.0
|
||||
- set default to LOG_NOTICE + overhaul levels
|
||||
- refactor proc-parsing
|
||||
- adaptions for daemon-names changed with
|
||||
pacemaker 2.0.0 rc3
|
||||
- added .do-not-sync-with-fedora
|
||||
Resolves: rhbz#1571797
|
||||
|
||||
* Mon Apr 16 2018 <kwenning@redhat.com> - 1.3.1-8
|
||||
- Added aarch64 target
|
||||
|
||||
Resolves: rhbz#1568029
|
||||
|
||||
* Mon Jan 15 2018 <kwenning@redhat.com> - 1.3.1-7
|
||||
- reenable sbd on upgrade so that additional
|
||||
links to make pacemaker properly depend on
|
||||
sbd are created
|
||||
|
||||
Resolves: rhbz#1525981
|
||||
|
||||
* Wed Jan 10 2018 <kwenning@redhat.com> - 1.3.1-5
|
||||
- add man sections for query- & test-watchdog
|
||||
|
||||
Resolves: rhbz#1462002
|
||||
|
||||
* Wed Dec 20 2017 <kwenning@redhat.com> - 1.3.1-3
|
||||
- mention timeout caveat with SBD_DELAY_START
|
||||
in configuration template
|
||||
- make systemd wait for sbd-start to finish
|
||||
before starting pacemaker or dlm
|
||||
|
||||
Resolves: rhbz#1525981
|
||||
|
||||
* Fri Nov 3 2017 <kwenning@redhat.com> - 1.3.1-2
|
||||
- rebase to upstream v1.3.1
|
||||
|
||||
Resolves: rhbz#1499864
|
||||
rhbz#1468580
|
||||
rhbz#1462002
|
||||
|
||||
* Wed Jun 7 2017 <kwenning@redhat.com> - 1.3.0-3
|
||||
- prevent creation of duplicate servants
|
||||
- check 2Node flag in corosync to support
|
||||
2-node-clusters with shared disk fencing
|
||||
- move disk-triggered reboot/off/crashdump
|
||||
to inquisitor to have sysrq observed by watchdog
|
||||
|
||||
Resolves: rhbz#1413951
|
||||
|
||||
* Sun Mar 26 2017 <kwenning@redhat.com> - 1.3.0-1
|
||||
- rebase to upstream v1.3.0
|
||||
- remove watchdog-limitation from description
|
||||
Resolves: rhbz#1413951
|
||||
|
||||
* Mon Feb 27 2017 <kwenning@redhat.com> - 1.2.1-23
|
||||
- if shared-storage enabled check for node-name <= 63 chars
|
||||
Resolves: rhbz#1413951
|
||||
|
||||
* Tue Jan 31 2017 <kwenning@redhat.com> - 1.2.1-22
|
||||
- Rebuild with shared-storage enabled
|
||||
- Package original manpage
|
||||
- Added ppc64le target
|
||||
Resolves: rhbz#1413951
|
||||
|
||||
* Fri Apr 15 2016 <kwenning@redhat.com> - 1.2.1-21
|
||||
- Rebuild for new pacemaker
|
||||
Resolves: rhbz#1320400
|
||||
|
||||
* Fri Apr 15 2016 <kwenning@redhat.com> - 1.2.1-20
|
||||
- tarball updated to c511b0692784a7085df4b1ae35748fb318fa79ee
|
||||
from https://github.com/Clusterlabs/sbd
|
||||
Resolves: rhbz#1324240
|
||||
|
||||
* Thu Jul 23 2015 <abeekhof@redhat.com> - 1.2.1-5
|
||||
- Rebuild for pacemaker
|
||||
|
||||
* Tue Jun 02 2015 <abeekhof@redhat.com> - 1.2.1-4
|
||||
- Include the dist tag in the release string
|
||||
- Rebuild for new pacemaker
|
||||
|
||||
* Mon Jan 12 2015 <abeekhof@redhat.com> - 1.2.1-3
|
||||
- Correctly parse SBD_WATCHDOG_TIMEOUT into seconds (not milliseconds)
|
||||
|
||||
* Mon Oct 27 2014 <abeekhof@redhat.com> - 1.2.1-2
|
||||
- Correctly enable /proc/pid validation for sbd_lock_running()
|
||||
|
||||
* Fri Oct 24 2014 <abeekhof@redhat.com> - 1.2.1-1
|
||||
- Further improve integration with the el7 environment
|
||||
|
||||
* Thu Oct 16 2014 <abeekhof@redhat.com> - 1.2.1-0.5.872e82f3.git
|
||||
- Disable unsupported functionality (for now)
|
||||
|
||||
* Wed Oct 15 2014 <abeekhof@redhat.com> - 1.2.1-0.4.872e82f3.git
|
||||
- Improved integration with the el7 environment
|
||||
|
||||
* Tue Sep 30 2014 <abeekhof@redhat.com> - 1.2.1-0.3.8f912945.git
|
||||
- Only build on archs supported by the HA Add-on
|
||||
|
||||
* Fri Aug 29 2014 <abeekhof@redhat.com> - 1.2.1-0.2.8f912945.git
|
||||
- Remove some additional SUSE-isms
|
||||
|
||||
* Fri Aug 29 2014 <abeekhof@redhat.com> - 1.2.1-0.1.8f912945.git
|
||||
- Prepare for package review
|
Loading…
Reference in New Issue
Block a user