[pgpool-committers: 3244] pgpool: Deal with the case when the primary is not node 0 in streaming

Tatsuo Ishii ishii at postgresql.org
Wed May 25 11:27:52 JST 2016


Deal with the case when the primary is not node 0 in streaming replication mode.

http://www.pgpool.net/mantisbt/view.php?id=194#c837 reported that if
primary is not node 0, then statement timeout could occur even after
bug194-3.3.diff was applied. After some investigation, it appeared
that MASTER macro could return other than primary or load balance
node, which was not supposed to happen, thus do_query() sends queries
to wrong node (this is not clear from the report but I confirmed it in
my investigation).

pool_virtual_master_db_node_id(), which is called in MASTER macro
returns query_context->virtual_master_node_id if query context
exists. This could return wrong node if the variable has not been set
yet. To fix this, the function is modified: if the variable is not
either load balance node or primary node, the primary node id is
returned.

Branch
------
V3_3_STABLE

Details
-------
http://git.postgresql.org/gitweb?p=pgpool2.git;a=commitdiff;h=bc01f4f7b1fe9c18fe4411b42b29b64f17eb387c

Modified Files
--------------
pool_query_context.c | 18 +++++++++++++++++-
1 file changed, 17 insertions(+), 1 deletion(-)



More information about the pgpool-committers mailing list