Re: Dangling Client Backend Process - Mailing list pgsql-hackers

From Rajeev rastogi
Subject Re: Dangling Client Backend Process
Date
Msg-id BF2827DCCE55594C8D7A8F7FFD3AB771599653F7@szxeml521-mbs.china.huawei.com
Whole thread Raw
In response to Re: Dangling Client Backend Process  (Amit Kapila <amit.kapila16@gmail.com>)
List pgsql-hackers
<div class="WordSection1"><p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">On</span><span
style="font-size:10.0pt;font-family:"Tahoma","sans-serif"">10October 2015 20:45, Amit Kapila Wrote:</span><p
class="MsoNormal"><spanstyle="font-size:10.0pt;font-family:"Tahoma","sans-serif""> </span><p class="MsoNormal"><span
style="font-size:13.0pt">>>I observed one strange behavior today that if postmaster process gets crashed/killed,
thenit kill all background processes but not the client backend process.</span><p class="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><pclass="MsoNormal">> This is a
knownbehaviour and there was some discussion on this<p class="MsoNormal">> topic [1] previously as well.  I think
thatthread didn't reach to conclusion,<p class="MsoNormal">> but there were couple of other reasons discussed in
thatthread as well to<p class="MsoNormal">> have the behaviour as you are proposing here.<p class="MsoNormal"> <p
class="MsoNormal"><spanstyle="font-size:13.0pt">Oops..I did not know about this. I shall check the older thread to get
otheropinions.</span><p class="MsoNormal"> <p class="MsoNormal"><span style="font-size:13.0pt">>> One way to
handlethis issue will be to check whether postmaster is alive after every command read but it will add extra cost for
eachquery execution.</span><p class="MsoNormal"><span style="font-size:13.0pt"> </span><p class="MsoNormal">> I
don'tthink that is a good idea as if there is no command execution<p class="MsoNormal">> it will still stay as it is
anddoing such operations on each command<p class="MsoNormal">> doesn't sound to be good idea even though overhead
mightnot be<p class="MsoNormal">> big.  There are some other ideas discussed in that thread [2] to achieve<p
class="MsoNormal">>this behaviour, but I think we need to find a portable way to achieve it.<p
class="MsoNormal"><spanstyle="font-size:13.0pt"> </span><p class="MsoNormal"><span style="font-size:13.0pt">Yes, you
areright that process will not be closed till a new command comes but I think it does not harm functionality in anyway
exceptthat the process and its acquired resources</span><p class="MsoNormal"><span style="font-size:13.0pt">does not
getfreed. Also use-case of application will be very less where their client process stays idle for very long
time.</span><pclass="MsoNormal"><span style="font-size:13.0pt">But at the same time I agree this is not the best
solution,we should look for more appropriate/better one. </span><p class="MsoNormal"><span style="font-size:13.0pt">Now
asit is confirmed to be valid issue, I will spend some time on this to find if there is something more appropriate
solution.</span><pclass="MsoNormal"><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D"> </span><pclass="MsoNormal"><i><span
style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black">Thanksand Regards,</span></i><p
class="MsoNormal"><i><spanstyle="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1F497D">Kumar Rajeev
Rastogi</span></i><i><spanstyle="font-size:11.0pt;font-family:"Calibri","sans-serif";color:black"> </span></i></div> 

pgsql-hackers by date:

Previous
From: Haribabu Kommi
Date:
Subject: Re: Parallel Seq Scan
Next
From: Peter Geoghegan
Date:
Subject: Re: More work on SortSupport for text - strcoll() and strxfrm() caching