[pgpool-hackers: 1419] Re: Idea for 3.5: switch over script

Yugo Nagata nagata at sraoss.co.jp
Mon Feb 22 15:59:45 JST 2016

Hi all,

I remember this thread posted a year ago. I think it is good
to add the switch-over command option and the sample script
to 3.6 since I sometimes heard such requirements that users
want to switch-over the backend without restarting or
denegerating backend manually.

On Thu, 30 Apr 2015 13:55:16 +0900 (JST)
Tatsuo Ishii <ishii at postgresql.org> wrote:

> Now that PostgreSQL 9.5 has pg_rewind in core, I would like to propose
> adding new directive "switchver_script", whose function is almost same
> as failover_script except that the former is called only when switch
> over is requested, which will be triggered by new command
> "pcp_switchover".
> Switchover_script will execute pg_rewind, thus has an advantage over
> pg_basebackup or rsync (or whatever) used to recover new standby, in
> terms of recovery duration because pg_rewinrd does not require copying
> whole database cluster. The reason why pg_rewind cannot be used for
> failover_script is, pg_rewind will not work for the primary server
> crash case. That's the reason why we need to have a separate script
> for the switch over case.
> pcp_switchover works like this:
> 1) pcp_switchover --mode prepare --node node_number
>    Prepare switchover. From now on, pgpool-II will call
>    switchover_script rather than failover_script when a node goes
>    down. "--node" specifies a node to be promoted after switchover. If
>    this parameter is not specified, pgpool-II will automatically
>    select a standby node which is the first live standby node in
>    pgpool.conf.
> 2) After #1 is completed, the primary node is shutdown by an
>    operator. This triggers switchover and pgpool-II executes the
>    switchover_script. After switchover the node specified by --node
>    option will be promoted.
> 3) pcp_switchover --mode stop
>    If the operator decides to cancel the switchover work between
>    "pcp_switchover --mode prepare" and shutting down the primary for
>    some reason, this commands should be executed. This will clear
>    "switchover mode" and any event after this will trigger
>    failover_script as usual.
> Comments and suggesions are welcome.
> --
> Tatsuo Ishii
> SRA OSS, Inc. Japan
> English: http://www.sraoss.co.jp/index_en.php
> Japanese:http://www.sraoss.co.jp
> _______________________________________________
> pgpool-hackers mailing list
> pgpool-hackers at pgpool.net
> http://www.pgpool.net/mailman/listinfo/pgpool-hackers

Yugo Nagata <nagata at sraoss.co.jp>

More information about the pgpool-hackers mailing list