<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Sorry for the delay in getting this to you, Ishii-san. All of my
    VM's were powered down after the chassis received a weekend upgrade.<br>
    <br>
    The log message I was referring to is (from a failover test
    performed last week):<br>
    <br>
    2014-07-23 24:54:56 LOG: pid 70166: pgpool_down: I'm <b>oldest</b>
    so standing for master<br>
    <br>
    This is written almost immediately before ifconfig brings up the IP
    alias address and before the failover_command is executed. That's
    what led me to my comments, although as I admitted, I had not read
    the code in this area. If selection is just by sequential node ID,
    that's a little misleading.<br>
    <br>
    <div class="moz-cite-prefix">On 7/28/2014 7:05 AM, Tatsuo Ishii
      wrote:<br>
    </div>
    <blockquote
      cite="mid:20140728.200552.2032094462298765311.t-ishii@sraoss.co.jp"
      type="cite">
      <pre wrap="">What are you referring to error message? I do not see anything like
"I'm the oldest, so assuming the master role." message in pgpool-II
code anywhere.

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: <a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp/index_en.php">http://www.sraoss.co.jp/index_en.php</a>
Japanese:<a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp">http://www.sraoss.co.jp</a>

</pre>
      <blockquote type="cite">
        <pre wrap="">Then, I hate to say it, Ishii-san, but your log message is a bit misleading. For instance, I always see a message during a failover where the standby claims, "I'm the oldest, so assuming the master role." So, maybe it should just "I have the lowest remaining node number, so I'm assuming the master role."  That wouldn't imply logic based on time, only sequences.

Sent from my iPad

</pre>
        <blockquote type="cite">
          <pre wrap="">On Jul 28, 2014, at 3:20 AM, Tatsuo Ishii <a class="moz-txt-link-rfc2396E" href="mailto:ishii@postgresql.org">&lt;ishii@postgresql.org&gt;</a> wrote:

No. Pgpool-II has no idea which server has been running longer.

Pgpool-II has no built-in logic to choose next
to-be-primary-candidate. Which slave node will be promoted next time
is completely depending on your failover script. In general most
people specifies the candidate slave as the master node, which has the
yonguest node number among live slave nodes (%m in failover script).
Example: you have node 0 primary, node 1&amp;2 standby.

1) node 0 is down.

2) node 1 is chosen as the next primary because it's the youngest live
node (master).

3) node 1 is down.

4) node 2 is chosen as the next primary because it's the youngest live
node (master).

Best regards,
--
Tatsuo Ishii
SRA OSS, Inc. Japan
English: <a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp/index_en.php">http://www.sraoss.co.jp/index_en.php</a>
Japanese:<a class="moz-txt-link-freetext" href="http://www.sraoss.co.jp">http://www.sraoss.co.jp</a>

</pre>
          <blockquote type="cite">
            <pre wrap="">Hey jay, thank you for the replay.
Is this is a formal conclusion? Maybe the oldest is the one with the
smaller ID ?



</pre>
            <blockquote type="cite">
              <pre wrap="">On Sun, Jul 27, 2014 at 2:50 PM, <a class="moz-txt-link-rfc2396E" href="mailto:jayknowsunix@gmail.com">&lt;jayknowsunix@gmail.com&gt;</a> wrote:

Guy,

I run a master with 2 slaves. During a failover, I always see the oldest
slave promoted to master. So, the selection is based on the server which
has been running longer.

--
Jay

Sent from my iPad

</pre>
              <blockquote type="cite">
                <pre wrap="">On Jul 27, 2014, at 3:48 AM, Guy Meler <a class="moz-txt-link-rfc2396E" href="mailto:melguy@gmail.com">&lt;melguy@gmail.com&gt;</a> wrote:

Hey :)
In master/slave mode, what is the algorithm for choosing the next
</pre>
              </blockquote>
              <pre wrap="">available primary backend?
</pre>
              <blockquote type="cite">
                <pre wrap="">I want to make sure that if primary in site A goes down, than the next
</pre>
              </blockquote>
              <pre wrap="">available primary is in the same site.
</pre>
              <blockquote type="cite">
                <pre wrap="">
Thank you

_______________________________________________
pgpool-general mailing list
<a class="moz-txt-link-abbreviated" href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a>
<a class="moz-txt-link-freetext" href="http://www.pgpool.net/mailman/listinfo/pgpool-general">http://www.pgpool.net/mailman/listinfo/pgpool-general</a>
</pre>
              </blockquote>
              <pre wrap="">
</pre>
            </blockquote>
          </blockquote>
        </blockquote>
      </blockquote>
      <pre wrap="">
</pre>
    </blockquote>
    <br>
  </body>
</html>