<div dir="ltr">No. All clients use persistent connections using c3p0 pool, user &#39;myuser&#39; and database &#39;mydb&#39;. Most of transactions use SET SESSION CHARACTERISTICS AS TRANSACTION READ ONLY; or SET SESSION CHARACTERISTICS AS TRANSACTION READ WRITE; but on pgpool1 I see that those transactions are executed on backend 0.</div><div class="gmail_extra"><br><div class="gmail_quote">On Tue, Aug 23, 2016 at 10:52 PM, Tatsuo Ishii <span dir="ltr">&lt;<a href="mailto:ishii@sraoss.co.jp" target="_blank">ishii@sraoss.co.jp</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><span class="">&gt;&gt; Can you identify the query which executed on the same time on pgpool2?<br>
&gt; Well this is interesting. In the logs I see queries executed as:<br>
&gt; 1. [local] - Queries sent by Zabbix agent<br>
<br>
</span>So not related to Pgpool-II.<br>
<span class=""><br>
&gt; 2. Health checks from pgpool1, which is primary, using user postgres and<br>
&gt; database template1<br>
<br>
</span>Ridiculous. From your pgpool.conf:<br>
<br>
health_check_user = &#39;healthcheck&#39;<br>
health_check_database = &#39;template1&#39;<br>
<span class=""><br>
&gt; 3. SR checks using user postgres and database mydb.<br>
<br>
</span>Ridiculous too.<br>
<br>
sr_check_user = &#39;postgres&#39;<br>
sr_check_database = &#39;template1&#39;<br>
<span class=""><br>
&gt; The processes in the list, however, show that username used for those<br>
&gt; connections is &#39;myuser&#39; and database is &#39;mydb&#39;. I found no entries with<br>
&gt; these values in PostgreSQL logfile.<br>
<br>
</span>One possibilty is, a user connected as &#39;myser&#39; and &#39;mydb&#39; then only<br>
issued some Pgppoll-II specific show commands like &quot;show<br>
pool_nodes&quot;. Can this ever happen?<br>
<div class="HOEnZb"><div class="h5"><br>
&gt; I also checked pgpool-II log on pgpool1, the primary node, and found no<br>
&gt; queries sent to backend id 1, all of them are sent to backend 0, which is<br>
&gt; pgpool1.<br>
&gt;<br>
&gt; Regards,<br>
&gt; Vlad<br>
&gt;<br>
&gt;<br>
&gt; On Tue, Aug 23, 2016 at 10:16 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt; wrote:<br>
&gt;<br>
&gt;&gt; Ok.<br>
&gt;&gt;<br>
&gt;&gt; &gt; Start time   : 2016-08-23 21:23:54<br>
&gt;&gt;<br>
&gt;&gt; This is the time when the pgpool process started. Since pgpool uses<br>
&gt;&gt; &quot;pre-fork&quot; method, in which all pgpool process are forked when pgpool<br>
&gt;&gt; starts. In summary, this is normal.<br>
&gt;&gt;<br>
&gt;&gt; &gt; Creation time: 2016-08-23 23:01:21<br>
&gt;&gt;<br>
&gt;&gt; This is the time when pgpool received a query from frontend and<br>
&gt;&gt; forwarded it to PostgreSQL (which I do not suppose to happen). Can you<br>
&gt;&gt; identify the query which executed on the same time on pgpool2?<br>
&gt;&gt;<br>
&gt;&gt; Best regards,<br>
&gt;&gt; --<br>
&gt;&gt; Tatsuo Ishii<br>
&gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt;<br>
&gt;&gt; &gt; They are relevant:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; [vlad@pgpool2 ~]$ ps ax | grep postgres<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; *62230* ?        Ss     0:00 postgres: myuser mydb 192.168.241.101(39856)<br>
&gt;&gt; &gt; idle<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; ...<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; [vlad@pgpool2 ~]$ pcp_proc_info -U postgres -w -h pgpool1 -v | grep -B7<br>
&gt;&gt; -A1<br>
&gt;&gt; &gt; 62230<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Database     : mydb<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Username     : myuser<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Start time   : 2016-08-23 21:23:54<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Creation time: 2016-08-23 23:01:21<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Major        : 3<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Minor        : 0<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Counter      : 2<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Backend PID  : *62230*<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; Connected    : 1<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt;From what I understand, connected stands for the backend id (which is 1<br>
&gt;&gt; in<br>
&gt;&gt; &gt; this case).<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt; On Tue, Aug 23, 2016 at 9:35 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt;<br>
&gt;&gt; wrote:<br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; You can use pcp_proc_info command to check if the PostgreSQL process<br>
&gt;&gt; &gt;&gt; are relevant to Pgpool-II or not.<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; <a href="http://www.pgpool.net/docs/latest/pgpool-en.html#pcp_proc_info" rel="noreferrer" target="_blank">http://www.pgpool.net/docs/<wbr>latest/pgpool-en.html#pcp_<wbr>proc_info</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt; Interesting thing, though, is that I see postgres processes being<br>
&gt;&gt; forked<br>
&gt;&gt; &gt;&gt; on<br>
&gt;&gt; &gt;&gt; &gt; pgpool2 eve though in the logs I see only the queries listed above.<br>
&gt;&gt; &gt;&gt; &gt; ...<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 65032 ?        Ss     0:00 *postgres*: myuser mydb<br>
&gt;&gt; 192.168.241.101(40278)<br>
&gt;&gt; &gt;&gt; &gt; idle<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 65033 ?        Ss     0:00 *postgres*: myuser mydb<br>
&gt;&gt; 192.168.241.101(40280)<br>
&gt;&gt; &gt;&gt; &gt; idle<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 65034 ?        Ss     0:00 *postgres*: myuser mydb<br>
&gt;&gt; 192.168.241.101(40282)<br>
&gt;&gt; &gt;&gt; &gt; idle<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 65035 ?        Ss     0:00 *postgres*: myuser mydb<br>
&gt;&gt; 192.168.241.101(40288)<br>
&gt;&gt; &gt;&gt; &gt; idle<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 65036 ?        Ss     0:00 *postgres*: myuser mydb<br>
&gt;&gt; 192.168.241.101(40290)<br>
&gt;&gt; &gt;&gt; &gt; idle<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; [vlad@pgpool2 ~]$ ps ax | grep postgres | grep myuser | wc -l<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; 317<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; Any ideas why can those processes be forked? It feels like pgpool<br>
&gt;&gt; creates<br>
&gt;&gt; &gt;&gt; &gt; slots just in case it needs to failover, but it&#39;s not documented<br>
&gt;&gt; anywhere<br>
&gt;&gt; &gt;&gt; &gt; and that&#39;s why it looks weird.<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt; On Tue, Aug 23, 2016 at 9:30 AM, Vlad Novikov &lt;<br>
&gt;&gt; <a href="mailto:xou.slackware@gmail.com">xou.slackware@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Ok, looks like the connections I see on pgpool2 are just healthchecks<br>
&gt;&gt; &gt;&gt; and<br>
&gt;&gt; &gt;&gt; &gt;&gt; standard db SELECT calls:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; SELECT 1;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; SELECT class.relname, blocking_activity.client_addr,<br>
&gt;&gt; &gt;&gt; &gt;&gt; blocking_activity.query FROM  pg_catalog.pg_locks blocked JOIN<br>
&gt;&gt; &gt;&gt; &gt;&gt; pg_catalog.pg_stat_activity a ON a.pid=blocked.pid JOIN<br>
&gt;&gt; &gt;&gt; pg_catalog.pg_locks<br>
&gt;&gt; &gt;&gt; &gt;&gt; locks ON locks.locktype = blocked.locktype AND locks.DATABASE IS NOT<br>
&gt;&gt; &gt;&gt; &gt;&gt; DISTINCT FROM blocked.DATABASE AND locks.relation IS NOT DISTINCT<br>
&gt;&gt; FROM<br>
&gt;&gt; &gt;&gt; &gt;&gt; blocked.relation AND locks.page IS NOT DISTINCT FROM blocked.page AND<br>
&gt;&gt; &gt;&gt; &gt;&gt; locks.tuple IS NOT DISTINCT FROM blocked.tuple AND locks.virtualxid<br>
&gt;&gt; IS<br>
&gt;&gt; &gt;&gt; NOT<br>
&gt;&gt; &gt;&gt; &gt;&gt; DISTINCT FROM blocked.virtualxid AND locks.transactionid IS NOT<br>
&gt;&gt; DISTINCT<br>
&gt;&gt; &gt;&gt; &gt;&gt; FROM blocked.transactionid AND locks.classid IS NOT DISTINCT FROM<br>
&gt;&gt; &gt;&gt; &gt;&gt; blocked.classid AND locks.objid IS NOT DISTINCT FROM blocked.objid<br>
&gt;&gt; AND<br>
&gt;&gt; &gt;&gt; &gt;&gt; locks.objsubid IS NOT DISTINCT FROM blocked.objsubid AND locks.pid !=<br>
&gt;&gt; &gt;&gt; &gt;&gt; blocked.pid JOIN pg_catalog.pg_stat_activity blocking_activity ON<br>
&gt;&gt; &gt;&gt; &gt;&gt; blocking_activity.pid=locks.<wbr>pid JOIN pg_catalog.pg_class class ON<br>
&gt;&gt; &gt;&gt; &gt;&gt; class.oid=locks.relation WHERE NOT blocked.GRANTED;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; I think we can consider this solved. Thank you, guys, for helping<br>
&gt;&gt; with<br>
&gt;&gt; &gt;&gt; &gt;&gt; this.<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; Vlad<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt; On Mon, Aug 22, 2016 at 3:41 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a>&gt;<br>
&gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Hello,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I attach node only when I start the failover node (PostgreSQL)<br>
&gt;&gt; after<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; primary is up and running. E.g. I start PostgreSQL on pgpool1,<br>
&gt;&gt; then I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; start<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; popool-II and it detects the backend.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Probably at this point a fail over happens because PostgreSQL<br>
&gt;&gt; pgpool2<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; is not running. So far so good.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Then, when I start pgpool2, I need to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; manually attach it, so pgpool-II would know that the backend is<br>
&gt;&gt; &gt;&gt; online,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; right?<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Correct.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Now nodes status. At this moment I see following nodes status:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; node_id  hostname   port   status   lb_weight  role<br>
&gt;&gt;  select_cnt<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; 0        pgpool1    5432      2     0.500000   primary    66133198<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; 1        pgpool2    5432      2     0.500000   standby    0<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; I don&#39;t know which node you executed &quot;show pool_nodes&quot; but as long<br>
&gt;&gt; as<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; the result of the command are same, it is ok.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; So you sometimes see write queries are sent to PostgreSQL on<br>
&gt;&gt; pgpool2?<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; I have a sneaky feeling that lb_weight has something to do about<br>
&gt;&gt; &gt;&gt; what is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; going on. However, if you take a look at the pgpool.conf attached<br>
&gt;&gt; to<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; initial message, you&#39;ll find the backends configured like this:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_hostname0 = &#39;pgpool1&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_port0 = 5432<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_weight0 = 1<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_data_directory0 = &#39;/var/lib/pgsql/9.4/data&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_flag0 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_hostname1 = &#39;pgpool2&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_port1 = 5432<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_weight1 = 1<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_data_directory1 = &#39;/var/lib/pgsql/9.4/data&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; backend_flag1 = &#39;ALLOW_TO_FAILOVER&#39;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; In particular, backend_weight is set to 1 on both nodes.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Don&#39;t worry. The load balance weight is always &quot;normalized&quot; so that<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; the tatal weight is 1.0.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Also, as far as I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; understand, this setting should not matter when<br>
&gt;&gt; &gt;&gt; load_balance_mode=off.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Correct.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; Vlad<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt; On Sat, Aug 20, 2016 at 4:37 PM, Tatsuo Ishii &lt;<a href="mailto:ishii@sraoss.co.jp">ishii@sraoss.co.jp</a><br>
&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Hi Lucas,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; I checked the log and found no failover entries. Here&#39;s how<br>
&gt;&gt; that<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; happens. I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; start two postgres backends (master-slave streaming<br>
&gt;&gt; replication)<br>
&gt;&gt; &gt;&gt; and<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; pgpool-II instance. Then I attach both of the nodes and<br>
&gt;&gt; initially<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; all the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; clients get connected to master only.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Why do you need attach the backends? Pgpool-II automatically<br>
&gt;&gt; attach<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; all backends valid in pgpool.conf.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; I see that with ps ax | grep<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; postgres. After some time new clients start getting connected<br>
&gt;&gt; to<br>
&gt;&gt; &gt;&gt; the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; hot<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; standby node while older clients are still connected to master.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; Again, I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; see that with ps ax | grep postgres. In that case both master<br>
&gt;&gt; and<br>
&gt;&gt; &gt;&gt; hot<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; standby have pgpool-II connected. That&#39;s what concerns me the<br>
&gt;&gt; &gt;&gt; most.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; If<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; there was a failover event, master would&#39;ve been detached and<br>
&gt;&gt; &gt;&gt; there<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; would<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; be no pgpool-II connections there.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Can you connect to pgool using psql then issue &quot;show pool_nodes&quot;<br>
&gt;&gt; &gt;&gt; when<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; pgpool starts to behaves like this? This should show which is the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; primary node (role) and which node should be the node the query<br>
&gt;&gt; &gt;&gt; routes<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; to (load_balance_node).<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Best regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; --<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Tatsuo Ishii<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; SRA OSS, Inc. Japan<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; English: <a href="http://www.sraoss.co.jp/index_en.php" rel="noreferrer" target="_blank">http://www.sraoss.co.jp/index_<wbr>en.php</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; Japanese:<a href="http://www.sraoss.co.jp" rel="noreferrer" target="_blank">http://www.sraoss.co.<wbr>jp</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; Vlad<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; On Sat, Aug 20, 2016 at 1:25 AM, Lucas Luengas &lt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="mailto:lucasluengas@gmail.com">lucasluengas@gmail.com</a>&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Hello.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; Have you checked pgpool log file?  Maybe a failover happened?<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; On Fri, Aug 19, 2016 at 10:48 PM, Vlad Novikov &lt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="mailto:xou.slackware@gmail.com">xou.slackware@gmail.com</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt; wrote:<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Hello,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; I&#39;m have setup pgpool-II with 2 backends in streaming mode<br>
&gt;&gt; (see<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; configuration file attached). In particular, I have<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; load_balance_mode<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; = off<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; to make sure that in this pool all connections will be<br>
&gt;&gt; &gt;&gt; established<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; streaming master only. However, over some time I see<br>
&gt;&gt; pgpool-II<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; establishing<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; connections to hot standby server. As a result client<br>
&gt;&gt; &gt;&gt; applications<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; start<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; failing as they cannot write to the database they&#39;re<br>
&gt;&gt; connected<br>
&gt;&gt; &gt;&gt; to.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; So<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; far<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; the only solution for me is to keep the hot standby detached<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; (which is<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; not<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; a good idea in terms of automated failover).<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Pgpool-II starts behaving like this at about 100 clients<br>
&gt;&gt; &gt;&gt; connected.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; PostgreSQL max_connections is set to 900 and with hot standby<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; detached<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; there are no connection issues reported (all clients can<br>
&gt;&gt; connect<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; to the<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; backend with no issues).<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; I use pgpool-II and PostgreSQL provided by PostgreSQL<br>
&gt;&gt; official<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; repository.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; PostgreSQL 9.4.9<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; pgpool-II 3.5.3<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; OS: CentOS 7.2<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Is there anything I need to change in the configuration file<br>
&gt;&gt; to<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; make<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; all<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; clients connect to master only when both backends are<br>
&gt;&gt; attached?<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; From<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; what I<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; understand that is expected with load_balance_mode = off.<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Regards,<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; Vlad<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; ______________________________<wbr>_________________<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; pgpool-general mailing list<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" rel="noreferrer" target="_blank">http://www.pgpool.net/mailman/<wbr>listinfo/pgpool-general</a><br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt; &gt;&gt;<br>
&gt;&gt; &gt;&gt;<br>
&gt;&gt;<br>
</div></div></blockquote></div><br></div>