[pgpool-general: 4331] Re: How to test pgpool?

kiet.h.lieng kiet.h.lieng at gmail.com
Fri Jan 15 13:02:09 JST 2016


Thanks Tatsuo.

> On Jan 12, 2016, at 11:45 PM, Tatsuo Ishii <ishii at postgresql.org> wrote:
> 
>>> Pgpool has a built in SQL parser inside. By using it, pgpool can know
>>> whether it gets update the database. If so, pgpool will route the
>>> query to the master (primary) PostgreSQL. If the query does not update
>>> the database, pgpool sends it to either the master or one of the
>>> standbys depending on the setting of configurations related to load
>>> balancing.
>>> 
>>> You could know which database server pgpool routes queries by using
>>> log_per_node_statement.
>> 
>> Is it not true that transactions are atomic?  If that is true then how can multiple queries be dissected as such?  It’s not really atomic if you can decide which transaction queries go where?
> 
> Atomicity? Because pgpool-II sends all write queries to the master
> node, all transactions including write queries are executed in atomic
> manner.
> 
> Even if a transaction includes read query it will be executed so that
> it does not break the atomicity.
> 
> BEGIN;
> READ query; --- might be sent to the standby node
> WRITE query; -- from now on all queries will be sent to the master node
> READ query; -- sent to the master node
> WRITE query; -- sent to the master node
> :
> END;
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp



More information about the pgpool-general mailing list