Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix: execd: Allow the SBD check to be explicitly disabled for bundles
  • Loading branch information
beekhof committed Oct 12, 2018
1 parent b67d8d0 commit ebbae86
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 4 deletions.
19 changes: 15 additions & 4 deletions daemons/execd/execd_commands.c
Expand Up @@ -1599,6 +1599,8 @@ process_lrmd_get_recurring(xmlNode *request, int call_id)
return reply;
}

static bool sbd_check_logged = FALSE;

void
process_lrmd_message(crm_client_t * client, uint32_t id, xmlNode * request)
{
Expand Down Expand Up @@ -1644,10 +1646,19 @@ process_lrmd_message(crm_client_t * client, uint32_t id, xmlNode * request)
do_notify = 1;
do_reply = 1;
} else if (crm_str_eq(op, LRMD_OP_CHECK, TRUE)) {
xmlNode *data = get_message_xml(request, F_LRMD_CALLDATA);
const char *timeout = crm_element_value(data, F_LRMD_WATCHDOG);
CRM_LOG_ASSERT(data != NULL);
check_sbd_timeout(timeout);
if(disable_sbd_check) {
if(sbd_check_logged == FALSE) {
crm_warn("Explicitly ignoring SBD check, this is only safe inside bundles");
sbd_check_logged = TRUE;
}

} else {
xmlNode *data = get_message_xml(request, F_LRMD_CALLDATA);

This comment has been minimized.

Copy link
@jnpkrn

jnpkrn Oct 12, 2018

Contributor

Please, make sure you have blank-at-eol and/or trailing-space set for
core.whitespace configuration variable of git, so that you can check
(e.g., git show if color.diff.whitespace is also suitably configured) you
are not introducing new white space issues.

This comment has been minimized.

Copy link
@jnpkrn

jnpkrn Oct 12, 2018

Contributor

Oh, I see this was pre-existing, but anyway, good to clean that up on the go.

const char *timeout = crm_element_value(data, F_LRMD_WATCHDOG);
CRM_LOG_ASSERT(data != NULL);
check_sbd_timeout(timeout);
}

} else if (crm_str_eq(op, LRMD_OP_ALERT_EXEC, TRUE)) {
rc = process_lrmd_alert_exec(client, id, request);
do_reply = 1;
Expand Down
5 changes: 5 additions & 0 deletions daemons/execd/pacemaker-execd.c
Expand Up @@ -36,6 +36,7 @@ static GMainLoop *mainloop = NULL;
static qb_ipcs_service_t *ipcs = NULL;
static stonith_t *stonith_api = NULL;
int lrmd_call_id = 0;
int disable_sbd_check = 0;

#ifdef ENABLE_PCMK_REMOTE
/* whether shutdown request has been sent */
Expand Down Expand Up @@ -507,6 +508,7 @@ static struct crm_option long_options[] = {
{"help", 0, 0, '?', "\tThis text"},
{"version", 0, 0, '$', "\tVersion information" },
{"verbose", 0, 0, 'V', "\tIncrease debug output"},
{"disable-sbd-check", 0, 0, 'D', "\tDisable the check for sbd - only safe for bundles"},

{"logfile", 1, 0, 'l', "\tSend logs to the additional named logfile"},
#ifdef ENABLE_PCMK_REMOTE
Expand Down Expand Up @@ -554,6 +556,9 @@ main(int argc, char **argv, char **envp)
case 'V':
bump_log_num++;
break;
case 'D':
disable_sbd_check = 1;
break;
case '?':
case '$':
crm_help(flag, CRM_EX_OK);
Expand Down
1 change: 1 addition & 0 deletions daemons/execd/pacemaker-execd.h
Expand Up @@ -19,6 +19,7 @@
# endif

GHashTable *rsc_list;
extern int disable_sbd_check;

typedef struct lrmd_rsc_s {
char *rsc_id;
Expand Down

0 comments on commit ebbae86

Please sign in to comment.