<div dir="ltr">Thank you very much for answer.</div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Sep 25, 2013 at 3:10 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="im">&gt; Hello,<br>
&gt;<br>
&gt; i have a little problem, or scenario that is happening and that I want to<br>
&gt; avoid.<br>
&gt;<br>
&gt; Here is scenario:<br>
&gt;<br>
&gt; I have two nodes named node1, and node2. node1 is primary, node2 is standby.<br>
&gt;<br>
&gt; - node1 fails<br>
&gt; - pgpool promote node2 to primary<br>
<br>
</div>Apparently you restart node1 at this point.<br>
<div class="im"><br>
&gt; - i restart pgpool service for whatever reason<br>
&gt; - pgpool is taking old primary (node1),to be primary again, even last state<br>
&gt; was that node2 is primary<br>
&gt; - pgpool is working with node1 as primary for some time, with old data<br>
&gt;<br>
&gt;<br>
&gt; After this,it is hard to check which node have newer data, and its hart not<br>
&gt; to lose one piece of data.<br>
&gt;<br>
&gt; How it is possible that pgpool take node1 as primary even if last state was<br>
&gt; that node2 was primary?<br>
<br>
</div>Because you restart node1 before restarting pgpool-II. Pgpool-II<br>
checks nodes one by one according to the order that they are written<br>
in pgpool.conf. Since pgpool-II finds that node1 is the primary, it<br>
assumes node1 is the primary. This could happen of if you restart<br>
pgpool-II with -D option, pgpool-II forgets previous node status.<br>
<div class="im"><br>
&gt; What is the best practice for this kind of situation?<br>
<br>
</div>Retart pgpool-II without -D option. Pgpool will remember that node1<br>
was down before and avoid to choose node1 as the primary.<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><br clear="all"><div><br></div>-- <br>Armin
</div>