[pgpool-general: 713] Re: Master/Slave Mode

Nozomi Anzai anzai at sraoss.co.jp
Tue Jul 10 10:38:22 JST 2012

> Hi everyone,
> I have a question concerning the Master/Slave Mode. I am not sure if I
> understand the documentation correctly.
> Is it true that a transaction is always executed on a single DB node in
> this mode? If so, how is it determined if a transaktion can be executed on
> a slave? Based on a read-only flag of the transaction?

Master/Slave mode works as follows:

- INSERT/UPDATE/DELETE statements are executed only in Master node.
- SELECT statements are load-balanced and pgpool decides to execute in
  the Master node OR in Slave nodes.

For example, if you use Streaming Replication as master_slave_sub_mode,
Slave nodes receive the PostgreSQL's inner logs (WAL: Write Ahead Log) in
which written what are executed in the Master node, and Slaves sync
themselves by received WALs.

> Or are Select and Insert/Update/Delete-statements executed on different
> nodes WITHIN a transaction?

No, pgpool doesn't work so in Master/Slave mode. 
# FYI, pgpool performs so in Replication mode for synchronous replication.

> Thanks for your replies.

Nozomi Anzai
SRA OSS, Inc. Japan

More information about the pgpool-general mailing list