[pgpool-general: 7463] Re: Expected behaviour after pcp_detach_node ?

Tatsuo Ishii ishii at sraoss.co.jp
Mon Mar 29 15:45:19 JST 2021


Hi,

> Hi!
> 
> What is the expected behaviour when detaching a node?
> I have a three-node test cluster with pgpool-II 4.1.3
> and PostgreSQL 12 like below.
> 
> 
> id | hostname | status | role | repl_delay | repl_state | repl_sync_st
> | last_status_change
>  0 | 10.0.0.1 | up | primary | 0 | | | 2021-03-25 12:18:27
>  1 | 10.0.0.2 | up | standby | 0 | streaming | async | 2021-03-25
>  12:18:56
>  2 | 10.0.0.3 | up | standby | 0 | streaming | async | 2021-03-25
>  12:18:56
> 
> *** Then I run "pcp_detach_node 0". The second node was promoted as
> *** expected:
> 
> id | hostname | status | role | repl_delay | repl_state | repl_sync_st
> | last_status_change
>  0 | 10.0.0.1 | down | standby | 0 | | | 2021-03-25 12:25:27
>  1 | 10.0.0.2 | up | primary | 0 | | | 2021-03-25 12:25:27
>  2 | 10.0.0.3 | down | standby | 0 | | | 2021-03-25 12:25:27
> 
> *** But then, the first one is back as primary again?
> 
> id | hostname | status | role | repl_delay | repl_state | repl_sync_st
> | last_status_change
>  0 | 10.0.0.1 | up | primary | 0 | | | 2021-03-25 12:25:36
>  1 | 10.0.0.2 | up | standby | 0 | | | 2021-03-25 12:25:36
>  2 | 10.0.0.3 | down | standby | 0 | | | 2021-03-25 12:25:27

This behavior is probably caused by the follow_master_command. Can you
share follow_master.sh?

> *** After that, returning as standby, the second node is primary:
> 
> id | hostname | status | role | repl_delay | repl_state | repl_sync_st
> | last_status_change
>  0 | 10.0.0.1 | up | standby | 0 | | | 2021-03-25 12:25:45
>  1 | 10.0.0.2 | up | primary | 0 | | | 2021-03-25 12:25:45
>  2 | 10.0.0.3 | up | standby | 0 | | | 2021-03-25 12:25:45
> 
> *** After all, this is the final state.
> 
> id | hostname | status | role | repl_delay | repl_state | repl_sync_st
> | last_status_change
>  0 | 10.0.0.1 | up | standby | 33463880 | | | 2021-03-25 12:25:45
>  1 | 10.0.0.2 | up | primary | 0 | | | 2021-03-25 12:25:45
>  2 | 10.0.0.3 | up | standby | 0 | streaming | async | 2021-03-25
>  12:25:45
> 
> So finally, the second node was promoted as expected.
> 
> But why is the first node "up" again even if it's not replicating?
> 
> See pgpool.conf attached.
> 
> Best regards,
>   Anssi Kanninen
> 
> 
> 
> 
> -- 
> anssi at iki.fi

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