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-Tag: XL_10_R1BETA1~22 X-Git-Url: http://git.postgresql.org/gitweb/static/gitweb.js?a=commitdiff_plain;h=ebb08756d4c5569bb1d6ad814a6bf1ca6a031bf4;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 6c6e8ebd9f..c29344eb37 100644 --- a/src/backend/postmaster/clustermon.c +++ b/src/backend/postmaster/clustermon.c @@ -277,6 +277,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 {