<div dir="ltr">Postgres can stop. So does the Linux, or the hardware. Network connection can be lost. You can blame me, but this is the real life.<div>This is why we use more than one of them. </div><div><br></div><div>If Pg stops, still I&#39;m sure that backend status must reflect this in all the pool members!</div>

<div>Even if a single pool cannot reach the backend, it should notify all others not to use that backend, or say good bye to your consistent database!</div><div><br></div><div>So finally: is there any status information what&#39;s shared among pool members? What is it, if not the backend database status?</div>

<div><br></div><div><br></div><div>Attila</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-06-20 9:47 GMT+02:00 Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@postgresql.org" target="_blank">ishii@postgresql.org</a>&gt;</span>:<br>

<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Attila,<br>
<br>
If you restart pgpool-II and the backend status which pgpool-II<br>
recognizes is different from actual PostgreSQL&#39;s staus, then it is<br>
likely that you stop or restart PostgreSQL between pgpool-II stops and<br>
restarts. In another other word, you directly changed backend situation<br>
without let pgpool-II notices it. i.e. your fault.<br>
<br>
Best regards,<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>
<div class="HOEnZb"><div class="h5"><br>
&gt; Yep, &quot;service pgpool2 force-reload&quot; has corrected this, but I am not happy<br>
&gt; at all.<br>
&gt;<br>
&gt; I thought that the pool status is consistent among the members. If pgpool<br>
&gt; does the replication, it is a disaster to have different backend sets in<br>
&gt; the pool members!<br>
&gt; No way to keep databases consistent... One pool will write just one<br>
&gt; backend, the other will write both.<br>
&gt;<br>
&gt; Attila<br>
&gt;<br>
&gt;<br>
&gt; 2014-06-19 12:08 GMT+02:00 Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt;:<br>
&gt;<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; On Thu, 19 Jun 2014 11:05:32 +0200<br>
&gt;&gt; Attila Heidrich &lt;<a href="mailto:attila.heidrich@gmail.com">attila.heidrich@gmail.com</a>&gt; wrote:<br>
&gt;&gt;<br>
&gt;&gt; &gt; Dear Guys,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; How on earth it is possible, that the pool members reports different<br>
&gt;&gt; &gt; backend status? It will cause problems very soon I guess.<br>
&gt;&gt;<br>
&gt;&gt; It is possible if pgpool reads old backend status info when this starts up.<br>
&gt;&gt; pgpool will discard the old backend info when starts with -D option.<br>
&gt;&gt;<br>
&gt;&gt; However, it would be better pgpools can detect the status mismatch<br>
&gt;&gt; between them in some way.<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 1<br>
&gt;&gt; &gt;     Host: <a href="tel:10.100.1.11" value="+3610100111">10.100.1.11</a><br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 2<br>
&gt;&gt; &gt;     Host: 10.100.1.10<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 1<br>
&gt;&gt; &gt;     Host: 10.100.1.11<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, detached from pool (3)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 2<br>
&gt;&gt; &gt;     Host: 10.100.1.10<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 1<br>
&gt;&gt; &gt;     Host: 10.100.1.11<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 2<br>
&gt;&gt; &gt;     Host: 10.100.1.10<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Active (3)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 1<br>
&gt;&gt; &gt;     Host: 10.100.1.11<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 2<br>
&gt;&gt; &gt;     Host: 10.100.1.10<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ---<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 1<br>
&gt;&gt; &gt;     Host: 10.100.1.11<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, detached from pool (3)<br>
&gt;&gt; &gt;     WD status: Standby (2)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;     Node: 2<br>
&gt;&gt; &gt;     Host: 10.100.1.10<br>
&gt;&gt; &gt;     Port: 5433<br>
&gt;&gt; &gt;     Weight: 0.500000<br>
&gt;&gt; &gt;     Status: Up, in pool (1)<br>
&gt;&gt; &gt;     WD status: Active (3)<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; I have got five pool members, two of them are the backends themselves.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Every pool member has the other 4 as other_pgpool, and<br>
&gt;&gt; &gt; heartbeat_destination, and the same two backend servers, here is the<br>
&gt;&gt; &gt; relevant part of the config for all pool members:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; nor-openfire-1:<br>
&gt;&gt; &gt;     backend_hostname1 = &#39;10.100.1.11&#39;<br>
&gt;&gt; &gt;     backend_port1 = 5433<br>
&gt;&gt; &gt;     backend_weight1 = 1<br>
&gt;&gt; &gt;     backend_data_directory1 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     backend_hostname2 = &#39;10.100.1.10&#39;<br>
&gt;&gt; &gt;     backend_port2 = 5433<br>
&gt;&gt; &gt;     backend_weight2 = 1<br>
&gt;&gt; &gt;     backend_data_directory2 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     fail_over_on_backend_error = on<br>
&gt;&gt; &gt;     heartbeat_destination0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port0 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port0 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port1 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port1 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port2 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port2 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port3 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port3 = 5432<br>
&gt;&gt; &gt; nor-postgres-1:<br>
&gt;&gt; &gt;     backend_hostname1 = &#39;10.100.1.11&#39;<br>
&gt;&gt; &gt;     backend_port1 = 5433<br>
&gt;&gt; &gt;     backend_weight1 = 1<br>
&gt;&gt; &gt;     backend_data_directory1 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     backend_hostname2 = &#39;10.100.1.10&#39;<br>
&gt;&gt; &gt;     backend_port2 = 5433<br>
&gt;&gt; &gt;     backend_weight2 = 1<br>
&gt;&gt; &gt;     backend_data_directory2 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     fail_over_on_backend_error = on<br>
&gt;&gt; &gt;     heartbeat_destination0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port0 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port0 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port1 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port1 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination2 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port2 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname2 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port2 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port3 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port3 = 5432<br>
&gt;&gt; &gt; nor-postgres-2:<br>
&gt;&gt; &gt;     backend_hostname1 = &#39;10.100.1.11&#39;<br>
&gt;&gt; &gt;     backend_port1 = 5433<br>
&gt;&gt; &gt;     backend_weight1 = 1<br>
&gt;&gt; &gt;     backend_data_directory1 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     backend_hostname2 = &#39;10.100.1.10&#39;<br>
&gt;&gt; &gt;     backend_port2 = 5433<br>
&gt;&gt; &gt;     backend_weight2 = 1<br>
&gt;&gt; &gt;     backend_data_directory2 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     fail_over_on_backend_error = on<br>
&gt;&gt; &gt;     heartbeat_destination0 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port0 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname0 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port0 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination1 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port1 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname1 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port1 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port2 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port2 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port3 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port3 = 5432<br>
&gt;&gt; &gt; nor-jboss-1:<br>
&gt;&gt; &gt;     backend_hostname1 = &#39;10.100.1.11&#39;<br>
&gt;&gt; &gt;     backend_port1 = 5433<br>
&gt;&gt; &gt;     backend_weight1 = 1<br>
&gt;&gt; &gt;     backend_data_directory1 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     backend_hostname2 = &#39;10.100.1.10&#39;<br>
&gt;&gt; &gt;     backend_port2 = 5433<br>
&gt;&gt; &gt;     backend_weight2 = 1<br>
&gt;&gt; &gt;     backend_data_directory2 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     fail_over_on_backend_error = on<br>
&gt;&gt; &gt;     heartbeat_destination0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port0 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port0 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port1 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname1 = &#39;nor-jboss-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port1 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination2 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port2 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname2 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port2 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination3 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port3 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname3 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port3 = 5432<br>
&gt;&gt; &gt; nor-jboss-2:<br>
&gt;&gt; &gt;     backend_hostname1 = &#39;10.100.1.11&#39;<br>
&gt;&gt; &gt;     backend_port1 = 5433<br>
&gt;&gt; &gt;     backend_weight1 = 1<br>
&gt;&gt; &gt;     backend_data_directory1 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     backend_hostname2 = &#39;10.100.1.10&#39;<br>
&gt;&gt; &gt;     backend_port2 = 5433<br>
&gt;&gt; &gt;     backend_weight2 = 1<br>
&gt;&gt; &gt;     backend_data_directory2 = &#39;/var/lib/postgresql/9.3&#39;<br>
&gt;&gt; &gt;     backend_flag2 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;     fail_over_on_backend_error = on<br>
&gt;&gt; &gt;     heartbeat_destination0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port0 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname0 = &#39;nor-postgres-2&#39;<br>
&gt;&gt; &gt;     other_pgpool_port0 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination1 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port1 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname1 = &#39;nor-openfire-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port1 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port2 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname2 = &#39;nor-postgres-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port2 = 5432<br>
&gt;&gt; &gt;     heartbeat_destination3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     heartbeat_destination_port3 = 9694<br>
&gt;&gt; &gt;     other_pgpool_hostname3 = &#39;nor-jboss-1&#39;<br>
&gt;&gt; &gt;     other_pgpool_port3 = 5432<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Other question:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Our servers are connected via two networks. Is it possible to specify a<br>
&gt;&gt; &gt; pool member with both IP interfaces?<br>
&gt;&gt;<br>
&gt;&gt; One other pgpool must be specified by single IP or hostname. You can use<br>
&gt;&gt; either<br>
&gt;&gt; of them. The exception is heartbeat destination; you can specify both IP<br>
&gt;&gt; as heartbeat_destinationX.<br>
&gt;&gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; ----------------------------------------------------------------------------------------<br>
&gt;&gt; &gt; Network #1<br>
&gt;&gt; &gt;              |                |                  |             |<br>
&gt;&gt; &gt;         |<br>
&gt;&gt; &gt;              S1           S2               S3          S4<br>
&gt;&gt; S5<br>
&gt;&gt; &gt;              |               |                    |            |<br>
&gt;&gt; &gt;         |<br>
&gt;&gt; &gt;<br>
&gt;&gt; ----------------------------------------------------------------------------------------<br>
&gt;&gt; &gt; Network #2<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; none of the networks are connected with failover connections, both use<br>
&gt;&gt; &gt; different IP subnets.<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Attila<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; --<br>
&gt;&gt; Yugo Nagata &lt;<a href="mailto:nagata@sraoss.co.jp">nagata@sraoss.co.jp</a>&gt;<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>