diff --git a/src/sbd-cluster.c b/src/sbd-cluster.c index 541212f..3d8ce6f 100644 --- a/src/sbd-cluster.c +++ b/src/sbd-cluster.c @@ -55,6 +55,7 @@ static int reconnect_msec = 1000; static GMainLoop *mainloop = NULL; static guint notify_timer = 0; static crm_cluster_t cluster; +static void clean_up(int rc); static gboolean sbd_remote_check(gpointer user_data); static long unsigned int find_pacemaker_remote(void); static void sbd_membership_destroy(gpointer user_data); @@ -335,17 +336,8 @@ sbd_membership_destroy(gpointer user_data) { cl_log(LOG_WARNING, "Lost connection to %s", name_for_cluster_type(get_cluster_type())); - if (get_cluster_type() != pcmk_cluster_unknown) { -#if SUPPORT_COROSYNC && CHECK_TWO_NODE - cmap_destroy(); -#endif - } - - set_servant_health(pcmk_health_unclean, LOG_ERR, "Cluster connection terminated"); - notify_parent(); - - /* Attempt to reconnect, the watchdog will take the node down if the problem isn't transient */ - sbd_membership_connect(); + /* Let the inquisitor handle reconnect by restarting the servant */ + clean_up(EXIT_CLUSTER_DISCONNECT); } /* @@ -533,6 +525,13 @@ find_pacemaker_remote(void) static void clean_up(int rc) { +#if SUPPORT_COROSYNC && CHECK_TWO_NODE + cmap_destroy(); +#endif + + if (rc >= 0) { + exit(rc); + } return; } diff --git a/src/sbd-inquisitor.c b/src/sbd-inquisitor.c index abde4e5..8fc9977 100644 --- a/src/sbd-inquisitor.c +++ b/src/sbd-inquisitor.c @@ -526,6 +526,20 @@ void inquisitor_child(void) break; } } + } else if (sbd_is_cluster(s)) { + if (WIFEXITED(status)) { + switch(WEXITSTATUS(status)) { + case EXIT_CLUSTER_DISCONNECT: + cl_log(LOG_WARNING, "Cluster-Servant has exited (cluster connection lost)"); + s->restarts = 0; + s->restart_blocked = 0; + s->outdated = 1; + s->t_last.tv_sec = 0; + break; + default: + break; + } + } } cleanup_servant_by_pid(pid); } diff --git a/src/sbd.h b/src/sbd.h index 3b05a11..45244ab 100644 --- a/src/sbd.h +++ b/src/sbd.h @@ -62,6 +62,9 @@ /* exit status for pcmk-servant */ #define EXIT_PCMK_SERVANT_GRACEFUL_SHUTDOWN 30 +/* exit status for cluster-servant */ +#define EXIT_CLUSTER_DISCONNECT 40 + #define HOG_CHAR 0xff #define SECTOR_NAME_MAX 63