<div dir="ltr">Hi pgpool experts,<div><br></div><div>Can you please clarify the below?</div><div><span class="gmail-im" style="color:rgb(80,0,80)"><div><b>During failover, Is the '*primary*' or '*MASTER*' or ' *load_balance_node* failure taken into account?</b><br></div></span><br class="gmail-Apple-interchange-newline"></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature" data-smartmail="gmail_signature"><div dir="ltr"><div><b>Thanks</b><br></div><i>Gopi</i><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 16, 2023 at 10:56 AM Gopikrishnan <<a href="mailto:nksgopikrishnan@gmail.com">nksgopikrishnan@gmail.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir="ltr">Thank you for your response!<div><br></div><div>Can you also kindly clarify this:</div><div> During failover, Is the '*primary*' or '*MASTER*' or ' *load_balance_node* failure taken into account?<br></div><div><br clear="all"><div><div dir="ltr" class="gmail_signature"><div dir="ltr"><div><b>Thanks</b><br></div><i>Gopi</i><br></div></div></div><br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Tue, May 16, 2023 at 10:26 AM Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">Hi,<br>
<br>
> Regd. which I couldn't gather much from the docs at:<br>
> <a href="https://www.pgpool.net/docs/pgpool-II-4.0.4/" rel="noreferrer" target="_blank">https://www.pgpool.net/docs/pgpool-II-4.0.4/</a><br>
> <br>
> <br>
>    1. primary<br>
>    2. MASTER<br>
>    3. load_balance_node<br>
<br>
1. primary: <br>
   It is the role of *PostgreSQL* nodes.<br>
   The role of PostgreSQL nodes can be primary or standby<br>
   in streaming replication mode.<br>
<br>
2. MASTER: <br>
   I think you are asking the status name shown <br>
   in the result of pcp_watchdog_info command.<br>
   The status name MASTER/STANDBY is the role of *Pgpool-II* node.<br>
   If you have multiple Pgpool-II nodes using watchdog feature,<br>
   one of them will be elected as MASTER and others will be STANDBY.<br>
<br>
3. load_balance_node<br>
   Pgpool-II supports for load balancing of SELECT queries.<br>
   When a session starts, pgpool will randomly elect one PostgreSQL node<br>
   as the load balance node (load_balance_node) and routes SELECTs to<br>
   the load_balance_node.<br>
<br>
On Mon, 15 May 2023 15:54:53 +0530<br>
Gopikrishnan <<a href="mailto:nksgopikrishnan@gmail.com" target="_blank">nksgopikrishnan@gmail.com</a>> wrote:<br>
<br>
> Hi folks,<br>
> <br>
> Need your help in clearing a confusion regd. basic terminologies:<br>
> <br>
> Regd. which I couldn't gather much from the docs at:<br>
> <a href="https://www.pgpool.net/docs/pgpool-II-4.0.4/" rel="noreferrer" target="_blank">https://www.pgpool.net/docs/pgpool-II-4.0.4/</a><br>
> <br>
> <br>
>    1. primary<br>
>    2. MASTER<br>
>    3. load_balance_node<br>
> <br>
> I have a pgpool with 3 nodes. I have a confusion between the pgpool primary and<br>
> the watchdog *MASTER* and the `*load_balance_node*`<br>
> <br>
> In my setup, the pgpool primary node (according to show pool_nodes output)<br>
> is : *10.108.104.31, *and also the node designated *load_balance_node*.<br>
> <br>
> While the MASTER node, according to pgpool watchdog, is: *10.108.104.32* And<br>
> the *cluster virtual IP* is attached to this node.<br>
> <br>
> I have the following questions in mind:<br>
> <br>
> <br>
>    1. What do the terms '*primary*' and '*MASTER*' and *load_balance_node*<br>
>    mean?<br>
>    2. During failover, Is the '*primary*' or '*MASTER*' or '<br>
>    *load_balance_node* failure taken into account?<br>
>    3. What is the difference (or any relation) between the '*primary*' and '<br>
>    *MASTER*' and *load_balance_node* nodes?<br>
>    4. If the cluster virtual IP is on the non '*primary*' node, wouldn't it<br>
>    affect the performance of the HA setup?<br>
> <br>
> Below are the outputs for *show pool_nodes *and* watchdog *info:<br>
> <br>
> psql -h delegateIP -p 9999 -U pgpool postgres -c "show pool_nodes"<br>
> Password for user pgpool:<br>
>  node_id |   hostname    | port | status | lb_weight |  role   |<br>
> select_cnt | load_balance_node | replication_delay |<br>
> last_status_change---------+---------------+------+--------+-----------+---------+------------+-------------------+-------------------+---------------------<br>
>  0       | 10.108.104.31 | 5432 | up     | 0.333333  | primary | 0<br>
>      | true              | 0                 | 2023-05-12 12:07:13<br>
>  1       | 10.108.104.32 | 5432 | up     | 0.333333  | standby | 0<br>
>      | false             | 0                 | 2023-05-12 12:07:13<br>
>  2       | 10.108.104.33 | 5432 | down   | 0.333333  | standby | 0<br>
>      | false             | 0                 | 2023-05-12 12:07:13<br>
> (3 rows)<br>
> <br>
> And the Watchdog info:<br>
> <br>
> pcp_watchdog_info -h localhost -vw -U pgpool<br>
> Watchdog Cluster Information<br>
> Total Nodes          : 3<br>
> Remote Nodes         : 2<br>
> Quorum state         : QUORUM EXIST<br>
> Alive Remote Nodes   : 2<br>
> VIP up on local node : NO<br>
> Master Node Name     : <a href="http://vm-104-32.eng.dev.com:9999" rel="noreferrer" target="_blank">vm-104-32.eng.dev.com:9999</a> Linux <a href="http://vm-104-32.eng.dev.com" rel="noreferrer" target="_blank">vm-104-32.eng.dev.com</a><br>
> Master Host Name     : 10.108.104.32<br>
> <br>
> Watchdog Node Information<br>
> Node Name      : <a href="http://vm-104-31.eng.dev.com:9999" rel="noreferrer" target="_blank">vm-104-31.eng.dev.com:9999</a> Linux <a href="http://vm-104-31.eng.dev.com" rel="noreferrer" target="_blank">vm-104-31.eng.dev.com</a><br>
> Host Name      : <a href="http://vm-104-31.eng.dev.com" rel="noreferrer" target="_blank">vm-104-31.eng.dev.com</a><br>
> Delegate IP    : 10.108.104.34<br>
> Pgpool port    : 9999<br>
> Watchdog port  : 9000<br>
> Node priority  : 1<br>
> Status         : 7<br>
> Status Name    : STANDBY<br>
> <br>
> Node Name      : <a href="http://vm-104-32.eng.dev.com:9999" rel="noreferrer" target="_blank">vm-104-32.eng.dev.com:9999</a> Linux <a href="http://vm-104-32.eng.dev.com" rel="noreferrer" target="_blank">vm-104-32.eng.dev.com</a><br>
> Host Name      : 10.108.104.32<br>
> Delegate IP    : 10.108.104.34<br>
> Pgpool port    : 9999<br>
> Watchdog port  : 9000<br>
> Node priority  : 1<br>
> Status         : 4<br>
> Status Name    : MASTER<br>
> <br>
> Node Name      : <a href="http://vm-104-33.eng.dev.com:9999" rel="noreferrer" target="_blank">vm-104-33.eng.dev.com:9999</a> Linux <a href="http://vm-104-33.eng.dev.com" rel="noreferrer" target="_blank">vm-104-33.eng.dev.com</a><br>
> Host Name      : 10.108.104.33<br>
> Delegate IP    : 10.108.104.34<br>
> Pgpool port    : 9999<br>
> Watchdog port  : 9000<br>
> Node priority  : 1<br>
> Status         : 7<br>
> Status Name    : STANDBY<br>
> <br>
> <br>
> <br>
> *Thanks & Regards*<br>
> *Gopi*<br>
<br>
<br>
-- <br>
Bo Peng <<a href="mailto:pengbo@sraoss.co.jp" target="_blank">pengbo@sraoss.co.jp</a>><br>
SRA OSS LLC<br>
<a href="https://www.sraoss.co.jp/" rel="noreferrer" target="_blank">https://www.sraoss.co.jp/</a><br>
</blockquote></div>
</blockquote></div>