From 257588554aa3f681a521c887cb0609e88c7192a2 Mon Sep 17 00:00:00 2001 From: Pavan Deolasee Date: Thu, 26 Nov 2015 13:06:46 +0530 Subject: Add a cluster monitor postmaster process Right now the process is responsible for computing the local RecentGlobalXmin and send periodic updates to the GTM. The GTM then computes a cluster-wide value of the RecentGlobalXmin and sends it back to all the reporting nodes (coordinators as well as datanodes). This way GTM does not need to track all open snapshots in the system, which previously required a transaction to remain open, even for a read-only operation. While this patch itself may not show major performance improvements, this will act as a foundation for other major improvements for transaction handling. If a node gets disconnected for a long time or stops sending updates to the GTM, such a node is removed from computation of the RecentGlobalXmin. This is to ensure that a failed node does not stop advancement of the RecentGlobalXmin beyond a certain point. Such a node can safely rejoin the cluster as long as its not using a snapshot with a stale view of the cluster i.e. a snapshot with xmin less than the RecentGlobalXmin that the GTM is running with. --- src/include/miscadmin.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/include/miscadmin.h') diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h index 6c47f8611d..b9e5919580 100644 --- a/src/include/miscadmin.h +++ b/src/include/miscadmin.h @@ -403,6 +403,7 @@ typedef enum WalReceiverProcess, #ifdef PGXC PoolerProcess, + ClusterMonitorProcess, #endif NUM_AUXPROCTYPES /* Must be last! */ @@ -416,6 +417,7 @@ extern AuxProcType MyAuxProcType; #define AmCheckpointerProcess() (MyAuxProcType == CheckpointerProcess) #define AmWalWriterProcess() (MyAuxProcType == WalWriterProcess) #define AmWalReceiverProcess() (MyAuxProcType == WalReceiverProcess) +#define AmClusterMonitorProcess() (MyAuxProcType == ClusterMonitorProcess) /***************************************************************************** -- cgit v1.2.3