[pgpool-general: 7669] Re: Executing failover on backend when stopping a standby node

Tatsuo Ishii ishii at sraoss.co.jp
Tue Aug 17 13:40:07 JST 2021


> Hi,
> I have a PgPool-II cluster running on 3 PostgreSQL 12 nodes (one primary +
> two standbies):
> 
> ============================================================================
> bash-4.4$ psql -h 127.0.0.1 -p 5432 -U repmgr -c "show pool_nodes;"
>  node_id | hostname  | port | status | lb_weight |  role   | select_cnt |
> load_balance_node | replication_delay | replication_state |
> replication_sync_stat
> e | last_status_change
> ---------+-----------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+----------------------
> --+---------------------
> 0 | postgres1 | 5432 | up | 0.333333 | primary | 19853211 | true | 0 | |
>   | 2021-08-08 07:30:22
> 1 | postgres2 | 5432 | up | 0.333333 | standby | 6686 | false | 0 | |
>   | 2021-08-11 07:11:46
> 2 | postgres3 | 5432 | up | 0.333333 | standby | 0 | false | 0 | |
>   | 2021-08-09 14:27:26
> (3 rows)
> ============================================================================
> 
> Load balancing mode is not enabled:
> 
> ============================================================================
> #------------------------------------------------------------------------------
> # LOAD BALANCING MODE
> #------------------------------------------------------------------------------
> 
> load_balance_mode = off
>                                    # Activate load balancing mode
>                                    # (change requires restart)
> ============================================================================
> 
> I stopped a standby to install a system update, but I realised that
> PgPool-II started a failover because clients received a PostgreSQL
> connection error for a couple of minutes: "failed to create a backend
> connection - Executing failover on backend".
> 
> This is not what I expect as no queries should be proxied to standbies, and
> I expect that if I shutdown a standby node clients should not realise
> anything and should not have any issue connecting to PostgreSQL.
> 
> Could you help me to understand where I'm wrong, please?
> 
> Thank you very much!
> Bye

Strange. In this case Pgpool-II does not restart Pgpool-II child
process and clients will not notice failover happened.

My guess is;

1) You do not enable health check. In this case new clients will
receive the error you mentioned.

2) The failover should not continue for long time like a few
minutes. For some reason I don't know your failover process takes
longer. Have you enabled watchdog? Or do you have special failover
command which could take long time?
--
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