[pgpool-general: 6747] Re: 答复: pgpool failover issue

Tatsuo Ishii ishii at sraoss.co.jp
Wed Oct 23 18:29:55 JST 2019


I assume these messages came from clients.

They are all expected behavior.  When failover happens, pgpool main
process kills all pgpool child process. From clients of pgpool's point
of view, they are observed as if the backend suddenly disconnects the
connection to client. Clents need to re-connect pgpool in this case.

> I redo the simulation for several times. Here is a list of possible errors:
> 1. An I/O error occurred when sending to the backend.
> 2. This connection has been closed.
> 3. The connection attempt failed.
> 4. failed to read kind from backend.
> 5. do command failed.
> 
> Best Regards,
> Xie Bin
> 
> -----邮件原件-----
> 发件人: xiebin (F) 
> 发送时间: 2019年10月21日 9:39
> 收件人: 'Tatsuo Ishii' <ishii at sraoss.co.jp>
> 抄送: pgpool-general at pgpool.net; zhubo (C) <zhubo31 at huawei.com>; Zhuzheng (IT) <zhuzheng at huawei.com>
> 主题: 答复: [pgpool-general: 6740] pgpool failover issue
> 
> The failover is not triggered by SQL Error. 
> Instead, I shut the database down to do simulation. "This connection has been closed" error is throwed out. 
> That is not what I expected because I thought pgpool would handle this error during primary-standby switch.
> 
> Best Regards,
> Xie Bin
> 
> -----邮件原件-----
> 发件人: Tatsuo Ishii [mailto:ishii at sraoss.co.jp]
> 发送时间: 2019年10月20日 12:37
> 收件人: xiebin (F) <xiebin18 at huawei.com>
> 抄送: pgpool-general at pgpool.net; zhubo (C) <zhubo31 at huawei.com>; Zhuzheng (IT) <zhuzheng at huawei.com>
> 主题: Re: [pgpool-general: 6740] pgpool failover issue
> 
>> Hi,
>> I was using pgpool4.0.6 + postgres10.5 to implement database HA. And it is accessed frequently by my Java Application (letʼs call it appJ).
>> Here is my problem:
>> I assumed pgpool shall detect the database error, promote standby so that the user/application could not even sense the error. When I shutdown the primary, the standby is promoted immediately. New connections can be established. Everything seems work fine. But appJ log shows that SQLException occurred. SQLs supposed to be done are discarded.
> 
> Basically SQL level errors (e.g. syntax errors, failed to insert data due to duplicate primary key errors) do not trigger fail over in Pgpool-II. What kind of error did you get?
> 
>> I tried both master-slave mode (master_slave_mode = on, 
>> master_slave_sub_mode = stream, relication_mode = off) and replication mode (maste_slave_mode = off, replication_mode = on). The problem is not solved.
>> Is there any way to solve it (with out improve appJ code)?
>> By the way, I find pgpool running modes quite confusing.
>> https://www.pgpool.net/docs/latest/en/html/configuring-pgpool.html
>> https://www.pgpool.net/docs/latest/en/html/runtime-config-running-mode
>> .html especially stream replication mode, replication mode, 
>> master-slave mode. What are connections and differences?
> 
> Replication mode does not rely on PostgreSQL's replication facility  i.e. streaming replication or logical replication.
> 
> On the other hand master slave mode relies on PostgreSQL's replication facility or Slony.
> 
> Best regards,
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp


More information about the pgpool-general mailing list