From bd75bf748f5dcbf7e7417599f635a4ec0658eb4a Mon Sep 17 00:00:00 2001 From: Ken Gaillot Date: Apr 07 2021 22:24:55 +0000 Subject: Log: libpacemaker: check for re-promotes specifically If a promotable clone instance is being demoted and promoted on its current node, without also stopping and starting, it previously would be logged as "Leave" indicating unchanged, because the current and next role are the same. Now, check for this situation specifically, and log it as "Re-promote". Currently, the scheduler is not capable of generating this situation, but upcoming changes will. --- diff --git a/lib/pacemaker/pcmk_sched_native.c b/lib/pacemaker/pcmk_sched_native.c index f14e690..89952bf 100644 --- a/lib/pacemaker/pcmk_sched_native.c +++ b/lib/pacemaker/pcmk_sched_native.c @@ -2561,9 +2561,17 @@ LogActions(pe_resource_t * rsc, pe_working_set_t * data_set, gboolean terminal) } else if (is_set(rsc->flags, pe_rsc_reload)) { LogAction("Reload", rsc, current, next, start, NULL, terminal); + } else if (start == NULL || is_set(start->flags, pe_action_optional)) { - pe_rsc_info(rsc, "Leave %s\t(%s %s)", rsc->id, role2text(rsc->role), - next->details->uname); + if ((demote != NULL) && (promote != NULL) + && is_not_set(demote->flags, pe_action_optional) + && is_not_set(promote->flags, pe_action_optional)) { + LogAction("Re-promote", rsc, current, next, promote, demote, + terminal); + } else { + pe_rsc_info(rsc, "Leave %s\t(%s %s)", rsc->id, + role2text(rsc->role), next->details->uname); + } } else if (is_not_set(start->flags, pe_action_runnable)) { LogAction("Stop", rsc, current, NULL, stop,