Recovery and takeover are run via helper from recovery daemon. While the
helpers are running, it's possible for the current node to lose election.
If that happens, abort the currently running recovery/takeover helper.
Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
struct tevent_fd *fde;
const char **args;
int nargs, ret;
+ uint32_t recmaster = rec->recmaster;
state = talloc_zero(mem_ctx, struct helper_state);
if (state == NULL) {
while (!state->done) {
tevent_loop_once(rec->ctdb->ev);
+
+ /* If recmaster changes, we have lost election */
+ if (recmaster != rec->recmaster) {
+ D_ERR("Recmaster changed to %u, aborting %s\n",
+ rec->recmaster, type);
+ state->result = 1;
+ break;
+ }
}
close(state->fd[0]);