<div dir="ltr"><div class="gmail_quote"><div dir="ltr">Hello,<div><br></div><div>let&#39;s try this again:</div><div>I&#39;m running a pgpool docker container that attaches to two nodes:</div><div><br></div><div>```</div><div><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">docker exec -it pgpool /bin/bash -c &#39;pgpool version&#39;<br style="box-sizing:inherit">pgpool-II version 4.1.1 (karasukiboshi),<br style="box-sizing:inherit">  A generic connection pool/replication/load balance server for PostgreSQL<span style="box-sizing:inherit;display:block;height:unset"></span>Usage:</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">```</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">With the following configuration:</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">```</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">listen_addresses = &#39;127.0.0.1&#39;<br>port = 5431<br>socket_dir = &#39;/var/run/postgresql&#39;<br>pcp_port = 9898<br>pcp_socket_dir = &#39;/var/run/postgresql&#39;<br>      backend_data_directory0 = &#39;/var/lib/postgresql/9.6/main&#39;<br>      backend_flag0 = &#39;DISALLOW_TO_FAILOVER&#39;<br>      backend_hostname0 = &#39;<a href="http://some.db.com/" target="_blank">some.db.com</a>&#39;<br>      backend_port0 = 5432<br>      backend_weight0 = 0<br>  backend_data_directory0 = &#39;/var/lib/postgresql/9.2/main&#39;<br>      backend_data_directory1 = &#39;/var/lib/postgresql/9.6/main&#39;<br>      backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>      backend_hostname1 = &#39;10.32.1.38&#39;<br>      backend_port1 = 5432<br>      backend_weight1 = 1<br>  backend_data_directory1 = &#39;/var/lib/postgresql/9.2/main&#39;<br>enable_pool_hba = on<br>authentication_timeout = 60<br>ssl = off<br>num_init_children = 329<br>max_pool = 1<br>child_life_time = 300<br>child_max_connections = 0<br>connection_life_time = 0<br>client_idle_limit = 150<br>log_destination = &#39;stderr&#39;<br>print_timestamp = on<br>log_connections = off<br>log_hostname = off<br>log_statement = off<br>log_per_node_statement = off<br>log_standby_delay = &#39;always&#39;<br>syslog_facility = &#39;LOCAL0&#39;<br>syslog_ident = &#39;pgpool&#39;<br>debug_level = 0<br>pid_file_name = &#39;/var/run/postgresql/pgpool.pid&#39;<br>logdir = &#39;/var/log/postgresql&#39;<br>connection_cache = off<br>reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>replication_mode = off<br>replicate_select = off<br>insert_lock = on<br>lobj_lock_table = &#39;&#39;<br>replication_stop_on_mismatch = off<br>failover_if_affected_tuples_mismatch = off<br>load_balance_mode = on<br>ignore_leading_white_space = on<br>white_function_list = &#39;&#39;<br>black_function_list = &#39;nextval,setval&#39;<br>master_slave_mode = on<br>master_slave_sub_mode = &#39;stream&#39;<br>sr_check_period = 5<br>sr_check_user = &#39;srcheck&#39;<br>follow_master_command = &#39;&#39;<br>parallel_mode = off<br>pgpool2_hostname = &#39;&#39;<br>system_db_hostname  = &#39;localhost&#39;<br>system_db_port = 5432<br>system_db_dbname = &#39;pgpool&#39;<br>system_db_schema = &#39;pgpool_catalog&#39;<br>system_db_user = &#39;pgpool&#39;<br>health_check_period = 5<br>health_check_timeout = 10<br>health_check_user = &#39;healthcheck&#39;<br>health_check_max_retries = 0<br>health_check_retry_delay = 1<br>failover_command = &#39;&#39;<br>failback_command = &#39;&#39;<br>failover_on_backend_error = off<br>search_primary_node_timeout = 10<br>recovery_user = &#39;nobody&#39;<br>recovery_1st_stage_command = &#39;&#39;<br>recovery_2nd_stage_command = &#39;&#39;<br>recovery_timeout = 90<br>client_idle_limit_in_recovery = 0<br>use_watchdog = off<br>trusted_servers = &#39;&#39;<br>ping_path = &#39;/bin&#39;<br>wd_hostname = &#39;&#39;<br>wd_port = 9000<br>wd_authkey = &#39;&#39;<br>delegate_IP = &#39;&#39;<br>ifconfig_path = &#39;/sbin&#39;<br>if_up_cmd = &#39;ifconfig eth0:0 inet $_IP_$ netmask 255.255.255.0&#39;<br>if_down_cmd = &#39;ifconfig eth0:0 down&#39;<br>arping_cmd = &#39;arping -U $_IP_$ -w 1&#39;<br>clear_memqcache_on_escalation = on<br>wd_escalation_command = &#39;&#39;<br>wd_lifecheck_method = &#39;heartbeat&#39;<br>wd_interval = 10<br>wd_heartbeat_port = 9694<br>wd_heartbeat_keepalive = 2<br>wd_heartbeat_deadtime = 30<br>heartbeat_destination0 = &#39;host0_ip1&#39;<br>heartbeat_destination_port0 = 9694<br>heartbeat_device0 = &#39;&#39;<br>wd_life_point = 3<br>wd_lifecheck_query = &#39;SELECT 1&#39;<br>wd_lifecheck_dbname = &#39;postgres&#39;<br>wd_lifecheck_user = &#39;postgres&#39;<br>relcache_query_target = master<br>relcache_expire = 0<br>relcache_size = 256<br>check_temp_table = on<br>memory_cache_enabled = off<br>memqcache_method = &#39;shmem&#39;<br>memqcache_memcached_host = &#39;localhost&#39;<br>memqcache_memcached_port = 11211<br>memqcache_total_size = 67108864<br>memqcache_max_num_cache = 1000000<br>memqcache_expire = 0<br>memqcache_auto_cache_invalidation = on<br>memqcache_maxcache = 409600<br>memqcache_cache_block_size = 1048576<br>memqcache_oiddir = &#39;/var/log/pgpool/oiddir&#39;<br>white_memqcache_table_list = &#39;&#39;<br>black_memqcache_table_list = &#39;&#39;<br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">```</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">So we end up with the following `pool_nodes` result:</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">```</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"> node_id |                          hostname                          | port | status | lb_weight |  role   | select_cnt | load_balance_node | replication_delay | replication_state | replication_sync_state | last_status_change<br>---------+------------------------------------------------------------+------+--------+-----------+---------+------------+-------------------+-------------------+-------------------+------------------------+---------------------<br> 0       | <a href="http://some.db.com/" target="_blank">some.db.com</a> | 5432 | up     | 0.000000  | primary | 0          | false             | 0                 |                   |                        | 2020-03-31 22:04:22<br> 1       | 10.32.1.38                                                 | 5432 | up     | 1.000000  | standby | 0          | true              | 3283947928401     |                   |                        | 2020-03-31 22:04:22<br>(2 rows)<br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">```</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">At times, the &quot;standby&quot; node might go down for whatever reason. When I issue pcp_attach_node command to start sending queries to it - the whole pgpool interface seems to be disrupted:</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">- clients see disruption in queries</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">- no new queries are going through</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">- new connections to pgpool fail</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">Normal functionality is restored after about 2-5 seconds.</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">Is this an expected behavior or is there a more graceful way to reattach a node in pgpool?</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace"><br></pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">Thank you,</pre><pre style="color:rgb(209,210,211);white-space:pre-wrap;box-sizing:inherit;margin-top:4px;margin-bottom:4px;padding:8px;font-size:12px;line-height:1.50001;font-variant-ligatures:none;word-break:normal;border-radius:4px;font-family:Monaco,Menlo,Consolas,&quot;Courier New&quot;,monospace">Artem.</pre></div></div>
</div></div>