[pgpool-general: 6742] 答复: pgpool failover issue

xiebin (F) xiebin18 at huawei.com
Mon Oct 21 10:39:26 JST 2019


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