pgpool2.git / summary / log / commit / refs
commit 13c8b36ac0685fb606c1df6c024e62a68207f537
Author: Tatsuo Ishii <ishii@postgresql.org>
Date: Fri Dec 07 01:16:43 2012 +0000
Fix pool_search_relcache() to use MASTER or MASTER_NODE_ID macro,
rather than REAL_MASTER_NODE_ID. In case node 0 fail back in
streaming replication mode, pgpool does not restart child process. So
REAL_MASTER_NODE_ID looks for node 0 con info, which is not present
until new connection to backend made. Thus referring to node con info
results in segfault. MASTER or MASTER_NODE_ID are safe in this
situation because they look at cached former master node id.
pool_relcache.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/pool_relcache.c b/pool_relcache.c
index 0d8c4084a..821ade1ae 100644
--- a/pool_relcache.c
+++ b/pool_relcache.c
@@ -167,9 +167,9 @@ void *pool_search_relcache(POOL_RELCACHE *relcache, POOL_CONNECTION_POOL *backen
/* Not in cache. Check the system catalog */
snprintf(query, sizeof(query), relcache->sql, rel);
- per_node_statement_log(backend, REAL_MASTER_NODE_ID, query);
+ per_node_statement_log(backend, MASTER_NODE_ID, query);
- if (do_query(backend->slots[REAL_MASTER_NODE_ID]->con, query, &res, MAJOR(backend)) != POOL_CONTINUE)
+ if (do_query(MASTER(backend), query, &res, MAJOR(backend)) != POOL_CONTINUE)
{
pool_error("pool_search_relcache: do_query failed");
if (res)
[parent: dbfa5e95bb2a]