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