[Pgpool-general] backend hangs => pgpool hangs

Bruno Lustosa bruno.lists at gmail.com
Wed Feb 20 13:31:33 UTC 2008


Hello.

Today, I had a problem on my primary backend. Most processes were
trying to "INSERT", with status D. Could be something with the disk,
or something else. I tried to stop the postmaster, but it wouldn't
stop. killall -9 postmaster (I know that's bad) left all of them as
zombies. Also couldn't reboot the machine, even with -f. Most
importantly, I tried to open postgresql.conf, and vim wouldn't load
the file.
Anyway, that's probably hardware or something else, unrelated to pgpool.
However, all pgpool processes were trying to do the INSERTs. Checked
the log, and neither backend was dropped. Of course, the load on
primary was high, and 0 on the secondary, because pgpool was
apparently waiting for the INSERTs to succeed to be able to receive
connections once again.
Here is the output from ps axf on pgpool machine:

23695 ?        S      0:00 pgpool -n
23767 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58922) INSERT
23768 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46836) idle
23769 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46837) INSERT
23770 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58924) INSERT
23824 ?        S      0:00  \_ pgpool: PCP: wait for connection request
27340 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58932) INSERT
27788 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58928) INSERT
30960 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44687) INSERT
31099 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46831) idle
31111 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41290) idle
31116 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(52032) INSERT
31118 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(52031) idle
31120 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33263) INSERT
31121 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46792) INSERT
31125 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33259) idle
31126 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46789) INSERT
31133 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41284) INSERT
31134 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41283) idle
31135 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33254) idle
31142 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46784) SELECT
31143 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46783) idle
31147 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41277) INSERT
31150 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46799) INSERT
31151 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43124) INSERT
31163 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44679) INSERT
31164 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46832) INSERT
31177 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46814) INSERT
31184 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46804) INSERT
31195 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43099) INSERT
31200 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43109) INSERT
31201 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43108) idle
31202 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33280) idle
31203 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43106) INSERT
31214 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43113) INSERT
31215 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43112) idle
31218 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(50665) INSERT
31220 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43098) idle
31221 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41280) INSERT
31224 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33255) INSERT
31226 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43138) INSERT
31227 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44699) INSERT
31228 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46822) INSERT
31229 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33260) INSERT
31231 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46794) INSERT
31232 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46798) INSERT
31233 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(41291) INSERT
31240 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(38270) INSERT
31241 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46806) INSERT
31242 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46810) INSERT
31243 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46808) INSERT
31244 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46815) idle
31249 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44694) INSERT
31250 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(38245) INSERT
31257 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36736) SELECT
31258 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(38250) INSERT
31264 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58918) idle
31265 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58919) INSERT
31266 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36697) idle
31267 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36695) INSERT
31268 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36694) idle
31269 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44711) INSERT
31270 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(33281) INSERT
31271 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44710) idle
31274 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44707) INSERT
31275 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44706) idle
31276 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44704) INSERT
31277 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43145) INSERT
31282 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43142) INSERT
31283 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46826) INSERT
31284 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46825) idle
31287 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44683) INSERT
31292 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43126) INSERT
31296 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46867) INSERT
31297 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58955) INSERT
31298 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58954) idle
31299 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58952) INSERT
31300 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46816) INSERT
31301 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58951) idle
31306 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43134) INSERT
31308 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44698) idle
31309 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43137) idle
31311 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43141) idle
31314 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44703) idle
31315 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(43147) INSERT
31317 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36698) INSERT
31333 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46833) idle
31334 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46834) INSERT
31335 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46844) INSERT
31336 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58927) idle
31340 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46843) idle
31341 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44718) INSERT
31343 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58934) INSERT
31344 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36706) INSERT
31345 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36705) idle
31347 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46847) INSERT
31353 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36711) INSERT
31356 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46854) INSERT
31357 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46853) idle
31362 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46859) INSERT
31363 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46858) idle
31365 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(44728) INSERT
31369 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(46864) INSERT
31370 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58949) INSERT
31371 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58948) idle
31373 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36722) INSERT
31374 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60632) INSERT
31375 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60631) idle
31377 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58960) INSERT
31383 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(40126) INSERT
31385 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58966) INSERT
31386 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36732) SELECT
31387 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36731) idle
31388 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.22(36735) idle
31389 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(58970) INSERT
31390 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60644) INSERT
31392 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60642) INSERT
31395 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60650) INSERT
31396 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60648) INSERT
31397 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60655) INSERT
31398 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60653) INSERT
31400 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60658) INSERT
31405 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.72(40238) INSERT
31406 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60663) INSERT
31407 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60667) SELECT
31408 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60666) idle
31414 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60672) INSERT
31416 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60675) INSERT
31419 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.82(60679) idle
31420 ?        S      0:00  \_ pgpool: hvnovo hvnovo 192.168.10.12(40146) INSERT

I don't know if this is the expected behaviour, but in my opinion,
pgpool should drop a backend after it hangs for too much time. No?
And (don't know if it might help, but here it is anyway) the output of
ps axf on backend0 after I tried to killall -9:

 8343 ?        Ds     0:01 /usr/bin/postmaster -D
/var/lib/postgresql/data --silent-mode=true
 8352 ?        Zs     0:00  \_ [postmaster] <defunct>
 8353 ?        Ds     0:00  \_ postgres: stats collector process
15775 ?        Ds     0:00  \_ postgres: hvnovo hvnovo
192.168.10.2(51643) COMMIT
15776 ?        Zs     0:00  \_ [postmaster] <defunct>
15781 ?        Zs     0:00  \_ [postmaster] <defunct>
15782 ?        Zs     0:00  \_ [postmaster] <defunct>
15787 ?        Zs     0:00  \_ [postmaster] <defunct>
15789 ?        Zs     0:00  \_ [postmaster] <defunct>
(loads more of them)
16100 ?        Zs     0:00  \_ [postmaster] <defunct>
16103 ?        Zs     0:00  \_ [postmaster] <defunct>
16108 ?        Zs     0:00  \_ [postmaster] <defunct>
16990 ?        Ds     0:00  \_ postgres: rguedes rguedes
192.168.10.2(40997) SET
18418 ?        D      0:00 reboot -f
18497 ?        D      0:00 shutdown -h 0 w
18549 ?        D      0:00 sync

That last SET command is from a pg_dump, I think.

-- 
Bruno Lustosa <bruno at lustosa.net>
http://www.lustosa.net/


More information about the Pgpool-general mailing list