<div dir="ltr">Hi<div><br></div><div>A similar problem was recently reported by a user <a href="http://www.pgpool.net/mantisbt/view.php?id=107">http://www.pgpool.net/mantisbt/view.php?id=107</a></div><div><br></div><div>Fix of that issue was committed for pgpool-II 3.3 and 3.2, on 24th July which has rectified the problem.</div>
<div>Can you please check if the problem is solved in the latest code.</div><div><br></div><div>Thanks and regards,</div><div>Usama</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Mon, Jul 7, 2014 at 8:14 PM, Stefan Warten <span dir="ltr">&lt;<a href="mailto:sw@00101010.org" target="_blank">sw@00101010.org</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Ok, good to know. But if I understand correctly, this only shifts the<br>
problem away from the SET SESSION AUTHORIZATION DEFAULT query to RESET<br>
ALL, which is the next command in my reset_query_list.<br>
<br>
The question is still why isn&#39;t the connection properly closed but<br>
idles somewhere in the reset_query_list commands (state &#39;idle in<br>
transaction&#39;)?<br>
<br>
There are currently around 250 processes in this state in my pgpool,<br>
most of them are older than a day, ignoring timeouts like<br>
child_life_time and client_idle_limit. How can this issue be solved?<br>
<br>
Regards, SW.<br>
<div class="HOEnZb"><div class="h5"><br>
On Mon, Jul 7, 2014 at 2:27 PM, Lachezar Dobrev &lt;<a href="mailto:l.dobrev@gmail.com">l.dobrev@gmail.com</a>&gt; wrote:<br>
&gt;   There are some changes in the statistics since 9.3 or possibly others.<br>
&gt;   Before that connections would display IDLE or IDLE IN TRANSACTION<br>
&gt; when there is no query being executed. Now the pg_stat_activity will<br>
&gt; display the last executed query on the connection (VERY HANDY!). The<br>
&gt; queries are NOT stale or hung. They just happen to be the last<br>
&gt; executed. I get lots of COMMIT or ROLLBACK or SELECT 1. There is a new<br>
&gt; column in the pg_stat_activity called &quot;state&quot; that will display &#39;idle&#39;<br>
&gt; or &#39;active&#39; or &#39;idle in transaction&#39;.<br>
&gt;<br>
&gt; 2014-07-04 16:35 GMT+03:00 Stefan Warten &lt;<a href="mailto:sw@00101010.org">sw@00101010.org</a>&gt;:<br>
&gt;&gt; Hi,<br>
&gt;&gt;<br>
&gt;&gt; after I have upgraded Postgresql to 9.3, I get lots of &quot;DISCARD ALL&quot;<br>
&gt;&gt; queries in pgpool (state is &quot;idle in transaction&quot;) that never finish<br>
&gt;&gt; until I manually kill the processes or detach a node. Since this is<br>
&gt;&gt; not a satisfying situation, I am looking for the reason why they got<br>
&gt;&gt; stuck and how I can fix this.<br>
&gt;&gt;<br>
&gt;&gt; Versions in use:<br>
&gt;&gt; Systems are Ubuntu 12.04 LTS<br>
&gt;&gt; pgpool2=3.3.3-2.pgdg12.4+2<br>
&gt;&gt; postgresql-9.3=9.3.4-1.pgdg12.4+1<br>
&gt;&gt; postgresql-9.3-pgpool2=3.3.3-1.pgdg12.4+1<br>
&gt;&gt;<br>
&gt;&gt; Pgpool settings:<br>
&gt;&gt; child_life_time = 10<br>
&gt;&gt; client_idle_limit = 1200<br>
&gt;&gt;<br>
&gt;&gt; First thing I did to find out where it hangs, was that I changed<br>
&gt;&gt; reset_query_list to the single commands executed by DISCARD ALL<br>
&gt;&gt; according to <a href="http://www.postgresql.org/docs/9.3/static/sql-discard.html" target="_blank">http://www.postgresql.org/docs/9.3/static/sql-discard.html</a><br>
&gt;&gt;<br>
&gt;&gt; -reset_query_list = &#39;ABORT; DISCARD ALL&#39;<br>
&gt;&gt; +reset_query_list = &#39;ABORT; SET SESSION AUTHORIZATION DEFAULT; RESET<br>
&gt;&gt; ALL; DEALLOCATE ALL; CLOSE ALL; UNLISTEN *; SELECT<br>
&gt;&gt; pg_advisory_unlock_all(); DISCARD PLANS; DISCARD TEMP;&#39;<br>
&gt;&gt;<br>
&gt;&gt; It turned out that it actually hangs in SET SESSION AUTHORIZATION<br>
&gt;&gt; DEFAULT, query state is still &quot;idle in transaction&quot;. As mentioned<br>
&gt;&gt; before, queries never* finish (*at least not within a week!).<br>
&gt;&gt; According to child_life_time and client_idle_limit, I would expect<br>
&gt;&gt; them to not run much longer than 1200 seconds but they stay for days.<br>
&gt;&gt;<br>
&gt;&gt; Another thing I noticed is that the amount of SET processes in pgpool<br>
&gt;&gt; (82) is equal to the SET processes in Postgresql master (82) and equal<br>
&gt;&gt; to the sum of the SET processes in all Postgresql slaves (29+24+29=82)<br>
&gt;&gt; (see commands below).<br>
&gt;&gt;<br>
&gt;&gt; Any help or explaination is highly appreciated.<br>
&gt;&gt;<br>
&gt;&gt; Regards, SW.<br>
&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; PGPOOL ~ $ sudo -i -u postgres psql -p 9999 -c &quot;select count(*) from<br>
&gt;&gt; pg_stat_activity where query LIKE &#39; SET%&#39;;&quot;<br>
&gt;&gt;  count<br>
&gt;&gt; -------<br>
&gt;&gt;     82<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; PSQL-MASTER ~ $ sudo -i -u postgres psql -c &quot;select count(*) from<br>
&gt;&gt; pg_stat_activity where query LIKE &#39; SET%&#39;  AND<br>
&gt;&gt; client_addr=&#39;$pgpool_ipaddr&#39;;&quot;<br>
&gt;&gt;  count<br>
&gt;&gt; -------<br>
&gt;&gt;     82<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; PSQL-SLAVE1 ~ $ sudo -i -u postgres psql -c &quot;select count(*) from<br>
&gt;&gt; pg_stat_activity where query LIKE &#39; SET%&#39; AND<br>
&gt;&gt; client_addr=&#39;$pgpool_ipaddr&#39;;&quot;<br>
&gt;&gt;  count<br>
&gt;&gt; -------<br>
&gt;&gt;     29<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; PSQL-SLAVE2 ~ $ sudo -i -u postgres psql -c &quot;select count(*) from<br>
&gt;&gt; pg_stat_activity where query LIKE &#39; SET%&#39; AND<br>
&gt;&gt; client_addr=&#39;$pgpool_ipaddr&#39;;&quot;<br>
&gt;&gt;  count<br>
&gt;&gt; -------<br>
&gt;&gt;     24<br>
&gt;&gt; (1 row)<br>
&gt;&gt;<br>
&gt;&gt; PSQL-SLAVE2 ~ $ sudo -i -u postgres psql -c &quot;select count(*) from<br>
&gt;&gt; pg_stat_activity where query LIKE &#39; SET%&#39; AND<br>
&gt;&gt; client_addr=&#39;$pgpool_ipaddr&#39;;&quot;<br>
&gt;&gt;  count<br>
&gt;&gt; -------<br>
&gt;&gt;     29<br>
&gt;&gt; (1 row)<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; pgpool-general mailing list<br>
&gt;&gt; <a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
&gt;&gt; <a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
_______________________________________________<br>
pgpool-general mailing list<br>
<a href="mailto:pgpool-general@pgpool.net">pgpool-general@pgpool.net</a><br>
<a href="http://www.pgpool.net/mailman/listinfo/pgpool-general" target="_blank">http://www.pgpool.net/mailman/listinfo/pgpool-general</a><br>
</div></div></blockquote></div><br></div>