Hello,<div><br></div><div>I attach the logs for pgpool on server1 and server2.</div><div><br></div><div>The sequence is as described in my first email. Server 2 was made out of sync (simply stoppping postgres on server2) :</div>
<div><br></div><div><div><font face="courier new, monospace">[root@daphne-d pg_log]# psql -p 5431 -h 192.168.0.109 -c &quot;show pool_nodes;&quot; -U postgres</font></div><div><font face="courier new, monospace">psql: [root@daphne-d pg_log]# psql -p 5431 -h 192.168.0.109 -c &quot;show pool_nodes;&quot; -U postgres</font></div>
<div><font face="courier new, monospace"> node_id |   hostname    | port | status | lb_weight |  role</font></div><div><font face="courier new, monospace">---------+---------------+------+--------+-----------+--------</font></div>
<div><font face="courier new, monospace"> 0       | 192.168.0.102 | 5432 | 2      | 0.500000  | master</font></div><div><font face="courier new, monospace"> 1       | 192.168.0.103 | 5432 | 3      | 0.500000  | slave</font></div>
<div><font face="courier new, monospace">(2 rows)</font></div><div><br></div><div>and, then:</div><div><br></div><div>- stop pgpool 1 and pgpool2</div><div>- stop postgres1, </div><div>- start postgres2</div><div>- start pgpool2</div>
<div>- stop pgpool2</div><div>- start pgpool2</div><div><br></div><div><br></div><div>and, after those events, the situation was inverse:</div><div><br></div><div><div><font face="courier new, monospace">[root@daphne-d pg_log]# psql -p 5431 -h 192.168.0.109 -c &quot;show pool_nodes;&quot; -U postgres</font></div>
<div><font face="courier new, monospace"> node_id |   hostname    | port | status | lb_weight |  role</font></div><div><font face="courier new, monospace">---------+---------------+------+--------+-----------+--------</font></div>
<div><font face="courier new, monospace"> 0       | 192.168.0.102 | 5432 | 3      | 0.500000  | slave</font></div><div><font face="courier new, monospace"> 1       | 192.168.0.103 | 5432 | 2      | 0.500000  | master</font></div>
<div><font face="courier new, monospace">(2 rows)</font></div></div><div><br></div><div>Server2 was out of sync and only stopping postgres on server1 and restarting pgpool on server2 created that situation. Server2 was never synchronized explicitly but at it end of this sequence, it is the only live node.</div>
<div><br></div><div>Thanks</div><div><br></div><div>Gilbert</div><div><br></div><div><br></div><div><br><div class="gmail_quote">On Wed, Feb 13, 2013 at 7:07 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="HOEnZb"><div class="h5">&gt; Hello,<br>
&gt;<br>
&gt; I am still testing pgpool before deploying with our production database.<br>
&gt;<br>
&gt; When one of the databases goes down, my understanding is that it should be<br>
&gt; marked as down by pgpool until we resync it manually. However, in the<br>
&gt; following (admittedly paranoiac) scenario, I think that it does not:<br>
&gt;<br>
&gt; Here is the case. We have 2 identical computers both running pgpool and<br>
&gt; postgres. Here is sequence of events:<br>
&gt;<br>
&gt; - we have DB1 and DB2 running fine, perfectly in sync (replication mode)<br>
&gt; - DB2 goes down for some reason and comes back a little later, enough<br>
&gt; though to be marked as down by pgpool<br>
&gt; - we run like that a little while (DB2 now gets seriously out of sync)<br>
&gt; - now, just as a test, do the following:<br>
&gt;     - stop everything (pgpool1, pgpool2, DB1, DB2)<br>
&gt;     - start DB2  and then pgpool2<br>
&gt;     - everything is good, pgpool refuses to use DB2 (which is out of sync)<br>
&gt;    - however, stop and start again pgpool2 (with DB1 down and DB2 up) and<br>
&gt; now pgpool hapilly starts using DB2 (while it was marked out of sync)<br>
<br>
&gt; Is that a normal/desired behavior?  I would expect that DB2 should not be<br>
&gt; used until I run a sync manually or I tell pgpool to forget about the<br>
&gt; previous down status.<br>
<br>
</div></div>Pgpool uses DB2 while it is marked out of sync? (or it *was* out of<br>
sync, but now it is in sync?) This should not happen unless you are in<br>
raw mode(that means both replication_mode = off and master_slave_mode<br>
= off).<br>
<br>
Any can you please show me pgpool log?<br>
--<br>
Tatsuo Ishii<br>
SRA OSS, Inc. Japan<br>
English: <a href="http://www.sraoss.co.jp/index_en.php" target="_blank">http://www.sraoss.co.jp/index_en.php</a><br>
Japanese: <a href="http://www.sraoss.co.jp" target="_blank">http://www.sraoss.co.jp</a><br>
</blockquote></div><br></div></div>