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

Muhammad Usama m.usama at gmail.com
Tue May 6 20:08:09 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.


Author: Tatsuo Ishii <ishii at postgresql.org>

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

More information about the pgpool-committers mailing list