[pgpool-general: 3118] Re: detection of primary server

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


sorry, my mistake. The trigger file is putting it into normal mode.


On Fri, Aug 29, 2014 at 3:55 PM, Kent Tong <kent.tong.mo at gmail.com> wrote:

> Hi,
>
> 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();
>  pg_is_in_recovery
> -------------------
>  f
> (1 row)
>
> --
> Kent Tong
> IT author and consultant, child education coach
>



-- 
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/b1905213/attachment.html>


More information about the pgpool-general mailing list