<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"></head><body dir="auto">Hello,<div><br></div><div>I always use pgpool -m fast stop.</div><div>&nbsp;</div><div>According to the official documentation:</div><div><a href="https://www.pgpool.net/docs/40/en/html/pgpool.html">https://www.pgpool.net/docs/40/en/html/pgpool.html</a></div><div><br></div><div><h2 style="-webkit-text-size-adjust: auto; font-size: 1.3em; margin: 1.2em 0em; color: rgb(236, 88, 0); font-family: verdana, sans-serif;">Stopping&nbsp;<span class="PRODUCTNAME">Pgpool-II</span>&nbsp;main server</h2><p style="-webkit-text-size-adjust: auto; line-height: 1.3; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: verdana, sans-serif;">Here are options for the stop mode.</p><p style="-webkit-text-size-adjust: auto; line-height: 1.3; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: verdana, sans-serif;"></p><p style="-webkit-text-size-adjust: auto; line-height: 1.3; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: verdana, sans-serif;"></p><div class="VARIABLELIST" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: verdana, sans-serif;"><dl><dt><tt class="OPTION">-m&nbsp;<tt class="REPLACEABLE"><i>shutdown_mode</i></tt></tt><br><tt class="OPTION">--mode=<tt class="REPLACEABLE"><i>shutdown_mode</i></tt></tt></dt><dd><p style="line-height: 1.3;">Stop&nbsp;<span class="PRODUCTNAME" style="color: rgb(68, 0, 0);">Pgpool-II</span>.&nbsp;<tt class="VARNAME" style="color: rgb(68, 0, 0);">shutdown_mode</tt>&nbsp;is either&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">smart</tt>,&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">fast</tt>&nbsp;or&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">immediate</tt>. If&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">smart</tt>&nbsp;is specified,&nbsp;<span class="PRODUCTNAME" style="color: rgb(68, 0, 0);">Pgpool-II</span>&nbsp;will wait for all clients are disconnected. If&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">fast</tt>&nbsp;or&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">immediate</tt>&nbsp;are specified,&nbsp;<span class="PRODUCTNAME" style="color: rgb(68, 0, 0);">Pgpool-II</span>immediately stops itself without waiting for all clients are disconnected. There's no difference between&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">fast</tt>&nbsp;and&nbsp;<tt class="LITERAL" style="color: rgb(68, 0, 0);">immediate</tt>in the current implementation.</p></dd></dl></div></div><div><br></div><div>NOTE: Remember stop pgpools before postgres services. pgpool standby first and continue with the master. The same for postgres instances.</div><div><div class="VARIABLELIST" style="-webkit-text-size-adjust: auto; caret-color: rgb(0, 0, 0); color: rgb(0, 0, 0); font-family: verdana, sans-serif;"><dl><dd><p style="line-height: 1.3;"><br></p><p style="line-height: 1.3;"><br></p><p style="line-height: 1.3;"><br></p><p style="line-height: 1.3;"><br></p><p style="line-height: 1.3;">On 16 Jul 2020, at 17:41, Nikhil Shetty &lt;nikhil.dba04@gmail.com&gt; wrote:</p></dd></dl></div></div><div><div dir="ltr"><blockquote type="cite"><br></blockquote></div><blockquote type="cite"><div dir="ltr"><div dir="ltr">Hi Team,<div><br></div><div>I am testing pgpool for my workload.We have three nodes of pgpool used as a load balancer and connection pooler across three nodes of database servers.</div><div><br></div><div>All application connections to the database are through the pgpool. Without stopping the application, if we want to stop the pgpool using "systemctl stop edb-pgpool-4.0" then it takes a long time because connections are still coming to the pgpool. Pgpool is stopped only after no new connections appear + existing connections are terminated.</div><div><br></div><div>Even after Pgpool is stopped, I can see that files(.s.PGSQL.9898 and .s.PGSQL.9999) under socket_dir which in our case is /tmp are not removed. This does not allow the pgpool to start using&nbsp;

"systemctl start edb-pgpool-4.0". We have to manually remove the files under /tmp and then start pgpool.</div><div><br></div><div>I have two questions:</div><div>1. Before stopping pgpool, how can we prevent new connections from coming into pgpool without stopping the application and terminate&nbsp;the existing&nbsp;connections so that the stop command does not wait.</div><div>2. After stopping pgpool, why are files under /tmp not removed?</div><div><br></div><div>PS:Files are removed from /tmp if there are no connections via pgpool(this will never be the case in production environment)</div></div>
<span>_______________________________________________</span><br><span>pgpool-general mailing list</span><br><span>pgpool-general@pgpool.net</span><br><span>http://www.pgpool.net/mailman/listinfo/pgpool-general</span><br></div></blockquote></div></body></html>