[pgpool-committers: 1658] pgpool: Avoid to send queries to unrelated nodes in streaming replicati

Tatsuo Ishii ishii at postgresql.org
Mon Feb 24 14:09:21 JST 2014


Avoid to send queries to unrelated nodes in streaming replication mode.

Pgpool-II sends certain queries, such as BEGIN, END and SET commands to
all of DB nodes. However in streaming replication mode, only primary
node and at most one standby node are only concerned (if primacy node
is selected as the load balance node, only 1 node is concerned).

Think about 3 nodes cluster. Node 0 is primary, node 1 and 2 are
standby servers. Node 1 is selected as the load balance node. In this
case no query is needed to be sent to node 2, because DMLs are sent to
node 0 while SELECTs are sent to node 1.

For this purpose pool_setall_node_to_be_sent() is modified to only set
related nodes on the where_to_send node map. See [pgpool-hackers: 464]
for more details.

Branch
------
V3_1_STABLE

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

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



More information about the pgpool-committers mailing list