From: Michael P. <mic...@us...> - 2011-05-31 05:44:56
|
Project "Postgres-XC". The branch, PGXC-TrialMaster has been updated via 86fb8b6ba5bf6646ef32d03882b98ad46897dfe1 (commit) from 2c8118bade2df8636928aac73b73a2fc1e6c25cf (commit) - Log ----------------------------------------------------------------- commit 86fb8b6ba5bf6646ef32d03882b98ad46897dfe1 Author: Michael P <mic...@us...> Date: Tue May 31 14:30:42 2011 +0900 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. diff --git a/src/backend/postmaster/postmaster.c b/src/backend/postmaster/postmaster.c index b39dda0..406d0a1 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 ----------------------------------------------------------------------- Summary of changes: src/backend/postmaster/postmaster.c | 7 +++---- 1 files changed, 3 insertions(+), 4 deletions(-) hooks/post-receive -- Postgres-XC |