<div dir="ltr">sorry, my mistake. The trigger file is putting it into normal mode.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, Aug 29, 2014 at 3:55 PM, Kent Tong <span dir="ltr"><<a href="mailto:kent.tong.mo@gmail.com" target="_blank">kent.tong.mo@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi,<div><br></div><div>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!</div>
<div><br></div><div><div><font face="courier new, monospace">bash-4.1$ tail 9.2/data/pg_log/postgresql-Fri.log </font></div><div><font face="courier new, monospace">LOG: entering standby mode</font></div><div><font face="courier new, monospace">LOG: redo starts at 0/1A000020</font></div>
<div><font face="courier new, monospace">LOG: consistent recovery state reached at 0/1A0000C8</font></div><div><font face="courier new, monospace">LOG: trigger file found: /tmp/trigger</font></div><div><font face="courier new, monospace">LOG: redo done at 0/1A0000C8</font></div>
<div><font face="courier new, monospace">LOG: selected new timeline ID: 2</font></div><div><font face="courier new, monospace">LOG: database system is ready to accept read only connections</font></div><div><font face="courier new, monospace">LOG: archive recovery complete</font></div>
<div><font face="courier new, monospace">LOG: database system is ready to accept connections</font></div><div><font face="courier new, monospace">LOG: autovacuum launcher started</font></div><div><font face="courier new, monospace"><br>
</font></div><div><font face="courier new, monospace"><br></font></div><div><div><font face="courier new, monospace">bash-4.1$ psql postgres</font></div><div><font face="courier new, monospace">psql (9.2.9)</font></div><div>
<font face="courier new, monospace">Type "help" for help.</font></div><div><font face="courier new, monospace"><br></font></div><div><font face="courier new, monospace">postgres=# select pg_is_in_recovery();</font></div>
<div><font face="courier new, monospace"> pg_is_in_recovery </font></div><div><font face="courier new, monospace">-------------------</font></div><div><font face="courier new, monospace"> f</font></div><div><font face="courier new, monospace">(1 row)</font></div>
<span class="HOEnZb"><font color="#888888">
</font></span></div><span class="HOEnZb"><font color="#888888"><div><br></div>-- <br><div>Kent Tong</div><div>IT author and consultant, child education coach</div>
</font></span></div></div>
</blockquote></div><br><br clear="all"><div><br></div>-- <br><div>Kent Tong</div><div>IT author and consultant, child education coach</div>
</div>