[pgpool-general: 6228] Re: master/primary terminology

Tatsuo Ishii ishii at sraoss.co.jp
Mon Sep 10 11:20:23 JST 2018

> In the documentation about the failover settings, failover_command for
> example, what's the difference between "master" nodes/hostnames (%m, %M,
> %H), and "primary" node (%P).
> As a test, I have 3 Postgres servers set up with streaming replication:
> db0, db1 and db0, which are pgpool nodes 0, 1 and 2, respectively.  Node 1
> is the current Postgres replication master, and nodes 0 and 2 are
> replicants.  Node 1 is also the pgpool watchdog cluster master with the
> virtual IP address.
> If I shut down node 2 by stopping the postgresql service , the
> failover_command is called with these values:
> %m = 0
> %M = 0
> %H = db0
> %P = 1
> %P seems to reliably be the postgres replication master.  Node 0 was just
> one of the replicants both before and after the test.  What the
> significance of it being called a "master"?

Pgpool-II has been there before the streaming replication was
created. Pgpool-II has been doing replication itself: by issuing same
query to both master and slaves. In the replication mode, "master" is
just the youngest (= the smallest node id) node. So we inherit the

The master node id info is significant for Pgpool-II admins who are
designing failover script. The script needs to decides which node
should be promoted when the primary node goes down. The master node is
the good candidate to be promoted since it is guaranteed that the node
is alive when the script gets called.

Best regards,
Tatsuo Ishii
SRA OSS, Inc. Japan
English: http://www.sraoss.co.jp/index_en.php

More information about the pgpool-general mailing list