[pgpool-general: 3117] detection of primary server

Kent Tong kent.tong.mo at gmail.com
Fri Aug 29 16:55:20 JST 2014


pgpool uses pg_is_in_recovery() to detect if a backend is a standby or not.
However, a hot standby server will be in recovery mode only initially, then
it will enter the standby mode and pg_is_in_recovery() will return false
(see below for the actual output with PostgreSQL 9.2). It means that pgpool
will may mistake a hot standby as the primary? Thanks!

bash-4.1$ tail 9.2/data/pg_log/postgresql-Fri.log
LOG:  entering standby mode
LOG:  redo starts at 0/1A000020
LOG:  consistent recovery state reached at 0/1A0000C8
LOG:  trigger file found: /tmp/trigger
LOG:  redo done at 0/1A0000C8
LOG:  selected new timeline ID: 2
LOG:  database system is ready to accept read only connections
LOG:  archive recovery complete
LOG:  database system is ready to accept connections
LOG:  autovacuum launcher started

bash-4.1$ psql postgres
psql (9.2.9)
Type "help" for help.

postgres=# select pg_is_in_recovery();
(1 row)

Kent Tong
IT author and consultant, child education coach
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.sraoss.jp/pipermail/pgpool-general/attachments/20140829/279686cc/attachment.html>

More information about the pgpool-general mailing list