Skip to content

Commit ec4725b

Browse files
authored
Merge pull request #84 from wenningerk/pacemaker_exit_with_unmanaged
Fix: sbd-pacemaker: assume graceful exit if leftovers are unmanged
2 parents 6ee2dc1 + 824fe83 commit ec4725b

File tree

1 file changed

+31
-1
lines changed

1 file changed

+31
-1
lines changed

src/sbd-pacemaker.c

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -333,11 +333,41 @@ compute_status(pe_working_set_t * data_set)
333333
}
334334
}
335335

336+
/* If we are in shutdown-state once this will go on till the end.
337+
* If we've on top reached a state of 0 locally running resources
338+
* we can assume a clean shutdown.
339+
* Tricky are the situations where the node is in maintenance-mode
340+
* or resources are unmanaged. So if the node is in maintenance or
341+
* all left-over running resources are unmanaged we assume intention.
342+
*/
336343
if (node->details->shutdown) {
337344
pcmk_shutdown = 1;
338345
}
339-
if (pcmk_shutdown && !(node->details->running_rsc)) {
346+
if (pcmk_shutdown)
347+
{
340348
pcmk_clean_shutdown = 1;
349+
if (!(node->details->maintenance)) {
350+
GListPtr iter;
351+
352+
for (iter = node->details->running_rsc;
353+
iter != NULL; iter = iter->next) {
354+
resource_t *rsc = (resource_t *) iter->data;
355+
356+
357+
if (is_set(rsc->flags, pe_rsc_managed)) {
358+
pcmk_clean_shutdown = 0;
359+
crm_debug("not clean as %s managed and still running",
360+
rsc->id);
361+
break;
362+
}
363+
}
364+
if (pcmk_clean_shutdown) {
365+
crm_debug("pcmk_clean_shutdown because "
366+
"all managed resources down");
367+
}
368+
} else {
369+
crm_debug("pcmk_clean_shutdown because node is in maintenance");
370+
}
341371
}
342372
notify_parent();
343373
return;

0 commit comments

Comments
 (0)