From: Pavan Deolasee Date: Fri, 31 Aug 2018 09:42:42 +0000 (+0530) Subject: Force restart cluster monitor process if the GTM restarts X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=909be73f40cbf814f35cea5c981a24794bbead5c;p=postgres-xl.git Force restart cluster monitor process if the GTM restarts If GTM loses node registration information and returns GTM_ERRCODE_NODE_NOT_REGISTERED to the coordinator/datanode, restart the cluster monitor process (by simply exiting with exit code 0). This would ensure that the cluster monitor re-registers with the GTM and start cleanly. Per report by Virendra Kumar --- diff --git a/src/backend/postmaster/clustermon.c b/src/backend/postmaster/clustermon.c index 0eb0392863..633e0e9616 100644 --- a/src/backend/postmaster/clustermon.c +++ b/src/backend/postmaster/clustermon.c @@ -275,6 +275,17 @@ ClusterMonitorInit(void) continue; } } + else if (status == GTM_ERRCODE_NODE_NOT_REGISTERED) + { + /* + * If we're not registered on the GTM, it could be because the + * GTM is restarted. Just exit and let the cluster monitor be + * restarted again. + */ + elog(WARNING, "ClusterMonitor process exiting - node not " + "registered on the GTM"); + proc_exit(0); + } } else {