Skip to content

Commit 6ce5bb0

Browse files
committed
Fix: pacemakerd: interworking with sbd not using pacemakerd-api
1 parent 06da3c3 commit 6ce5bb0

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

daemons/pacemakerd/pacemakerd.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,7 @@ pcmk_shutdown_worker(gpointer user_data)
454454
crm_notice("Shutdown complete");
455455
pacemakerd_state = XML_PING_ATTR_PACEMAKERDSTATE_SHUTDOWNCOMPLETE;
456456
if (!fatal_error && running_with_sbd &&
457+
pcmk__get_sbd_sync_resource_startup() &&
457458
!shutdown_complete_state_reported_client_closed) {
458459
return TRUE;
459460
}
@@ -1248,10 +1249,15 @@ main(int argc, char **argv)
12481249
mainloop_add_signal(SIGTERM, pcmk_shutdown);
12491250
mainloop_add_signal(SIGINT, pcmk_shutdown);
12501251

1251-
if (running_with_sbd) {
1252+
if ((running_with_sbd) && pcmk__get_sbd_sync_resource_startup()) {
12521253
pacemakerd_state = XML_PING_ATTR_PACEMAKERDSTATE_WAITPING;
12531254
startup_trigger = mainloop_add_trigger(G_PRIORITY_HIGH, init_children_processes, NULL);
12541255
} else {
1256+
if (running_with_sbd) {
1257+
crm_warn("Enabling SBD_SYNC_RESOURCE_STARTUP would (if supported "
1258+
"by your sbd version) improve reliability of "
1259+
"interworking between SBD & pacemaker.");
1260+
}
12551261
pacemakerd_state = XML_PING_ATTR_PACEMAKERDSTATE_STARTINGDAEMONS;
12561262
init_children_processes(NULL);
12571263
}

include/crm/common/options_internal.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ bool pcmk__valid_utilization(const char *value);
111111

112112
// from watchdog.c
113113
long pcmk__get_sbd_timeout(void);
114+
bool pcmk__get_sbd_sync_resource_startup(void);
114115
long pcmk__auto_watchdog_timeout(void);
115116
bool pcmk__valid_sbd_timeout(const char *value);
116117

lib/common/watchdog.c

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -227,6 +227,21 @@ pcmk__get_sbd_timeout(void)
227227
return sbd_timeout;
228228
}
229229

230+
bool
231+
pcmk__get_sbd_sync_resource_startup(void)
232+
{
233+
static bool sync_resource_startup = false;
234+
static bool checked_sync_resource_startup = false;
235+
236+
if (!checked_sync_resource_startup) {
237+
sync_resource_startup =
238+
crm_is_true(getenv("SBD_SYNC_RESOURCE_STARTUP"));
239+
checked_sync_resource_startup = true;
240+
}
241+
242+
return sync_resource_startup;
243+
}
244+
230245
long
231246
pcmk__auto_watchdog_timeout()
232247
{

0 commit comments

Comments
 (0)