summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMichael P2011-05-31 05:30:42 +0000
committerMichael P2011-05-31 05:45:41 +0000
commit86fb8b6ba5bf6646ef32d03882b98ad46897dfe1 (patch)
tree2f95e62acfcc0b8857ed8601e9cdd7004129b928 /src
parent2c8118bade2df8636928aac73b73a2fc1e6c25cf (diff)
Correction of GTM connection initialization at backend start
When Coordinator <-> Coordinator connections were created due to a DDL or a utility query, backend coordinator initialized connections to GTM and Pooler on uselessly. This was increasing slightly the number of backends on GTM, possibly causing a crash due to a too high number of threads opened on GTM. A sudden crash of GTM may have huge impact on data visibility or consistency, so this bug was perhaps the origin of multiple problems seen during performance tests. It is thought that this bug is present in XC since the implementation of DDL synchronization, done in August/September 2010.
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/postmaster.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c
index b39dda0f8e..406d0a1234 100644
--- a/src/backend/postmaster/postmaster.c
+++ b/src/backend/postmaster/postmaster.c
@@ -3371,7 +3371,7 @@ BackendStartup(Port *port)
#ifdef PGXC /* PGXC_COORD */
/* Don't get a Pooler Handle if Postmaster is activated from another Coordinator */
- if (IS_PGXC_COORDINATOR)
+ if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
{
pool_handle = GetPoolManagerHandle();
if (pool_handle == NULL)
@@ -3414,11 +3414,10 @@ BackendStartup(Port *port)
BackendInitialize(port);
#ifdef PGXC /* PGXC_COORD */
- if (IS_PGXC_COORDINATOR)
+ if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
{
/* User is authenticated and dbname is known at this point */
PoolManagerConnect(pool_handle, port->database_name, port->user_name);
- InitGTM();
}
#endif
@@ -3428,7 +3427,7 @@ BackendStartup(Port *port)
#endif /* EXEC_BACKEND */
#ifdef PGXC /* PGXC_COORD */
- if (IS_PGXC_COORDINATOR)
+ if (IS_PGXC_COORDINATOR && !IsConnFromCoord())
PoolManagerCloseHandle(pool_handle);
#endif