Skip to content

Commit

Permalink
Fix: sbd-pacemaker: assume graceful exit if leftovers are unmanged
Browse files Browse the repository at this point in the history
  • Loading branch information
wenningerk committed Jun 11, 2019
1 parent 6ee2dc1 commit 824fe83
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion src/sbd-pacemaker.c
Original file line number Diff line number Diff line change
Expand Up @@ -333,11 +333,41 @@ compute_status(pe_working_set_t * data_set)
}
}

/* If we are in shutdown-state once this will go on till the end.
* If we've on top reached a state of 0 locally running resources
* we can assume a clean shutdown.
* Tricky are the situations where the node is in maintenance-mode
* or resources are unmanaged. So if the node is in maintenance or
* all left-over running resources are unmanaged we assume intention.
*/
if (node->details->shutdown) {
pcmk_shutdown = 1;
}
if (pcmk_shutdown && !(node->details->running_rsc)) {
if (pcmk_shutdown)
{
pcmk_clean_shutdown = 1;
if (!(node->details->maintenance)) {
GListPtr iter;

for (iter = node->details->running_rsc;
iter != NULL; iter = iter->next) {
resource_t *rsc = (resource_t *) iter->data;


if (is_set(rsc->flags, pe_rsc_managed)) {
pcmk_clean_shutdown = 0;
crm_debug("not clean as %s managed and still running",
rsc->id);
break;
}
}
if (pcmk_clean_shutdown) {
crm_debug("pcmk_clean_shutdown because "
"all managed resources down");
}
} else {
crm_debug("pcmk_clean_shutdown because node is in maintenance");
}
}
notify_parent();
return;
Expand Down

0 comments on commit 824fe83

Please sign in to comment.