如下所示,即使执行pg_ctl –mode immediate stop,仍然出现pg主进程无法停止的情况。因为walsender进程似乎一直无法停止。
2022-04-09 09:58:52.707936C @ postmaster 00000[2022-03-29 11:23:45 UTC] 0 [69880] LOG: received fast shutdown request
2022-04-09 09:59:20.104209C [unknown] zjh@postgres ::1(46696) walsender  57P03[2022-04-09 09:59:20 UTC] 0 [105097] FATAL:  the database system is shutting down
2022-04-09 09:59:50.114885C [unknown] zjh@postgres ::1(46982) walsender  57P03[2022-04-09 09:59:50 UTC] 0 [105229] FATAL:  the database system is shutting down
2022-04-09 10:01:20.569748C [unknown] zjh@postgres ::1(47824) walsender  57P03[2022-04-09 10:01:20 UTC] 0 [105720] FATAL:  the database system is shutting down
2022-04-09 10:01:50.574433C [unknown] zjh@postgres ::1(48110) walsender  57P03[2022-04-09 10:01:50 UTC] 0 [105842] FATAL:  the database system is shutting down
2022-04-09 10:01:57.128295C [unknown] zjh@postgres [local] client backend  57P03[2022-04-09 10:01:57 UTC] 0 [105880] FATAL:  the database system is shutting down
2022-04-09 10:02:20.580586C [unknown] zjh@postgres ::1(48392) walsender  57P03[2022-04-09 10:02:20 UTC] 0 [106038] FATAL:  the database system is shutting down
2022-04-09 10:02:50.584208C [unknown] zjh@postgres ::1(48676) walsender  57P03[2022-04-09 10:02:50 UTC] 0 [106177] FATAL:  the database system is shutting down
2022-04-09 10:03:20.590836C [unknown] zjh@postgres ::1(48958) walsender  57P03[2022-04-09 10:03:20 UTC] 0 [106349] FATAL:  the database system is shutting down
2022-04-09 10:03:30.541345C  @  postmaster  00000[2022-03-29 11:23:45 UTC] 0 [69880] LOG:  received immediate shutdown request
2022-04-09 10:03:50.595911C [unknown] zjh@postgres ::1(49244) walsender  57P03[2022-04-09 10:03:50 UTC] 0 [106474] FATAL:  the database system is shutting down
2022-04-09 10:04:20.605568C [unknown] zjh@postgres ::1(49526) walsender  57P03[2022-04-09 10:04:20 UTC] 0 [106635] FATAL:  the database system is shutting down
看进程情况:
[zjh@hs-10-20-30-193 log]$ ps axu | grep zjh | grep lightdb
zjh      102008  0.0  0.0      0     0 ?        Zs   09:50   0:00 [lightdb] <defunct>
zjh      105400  0.0  0.1 6652464 455388 ?      Ss   10:00   0:00 /home/zjh/lightdb-x-dev-server/bin/lightdb -D data
zjh      105405  0.0  0.0 163532  1620 ?        Ss   10:00   0:00 lightdb: logger 
zjh      105407  0.0  0.0 6652464 1660 ?        Ss   10:00   0:00 lightdb: checkpointer 
zjh      105408  0.1  0.0 6654008 52308 ?       Ss   10:00   0:00 lightdb: background writer 
zjh      105409  0.0  0.0 6652464 133092 ?      Ss   10:00   0:00 lightdb: walwriter 
zjh      105410  0.0  0.0 6656544 2676 ?        Ss   10:00   0:00 lightdb: autovacuum launcher 
zjh      105411  0.0  0.0 165788  1720 ?        Ss   10:00   0:00 lightdb: stats collector 
zjh      105412  0.0  0.0 6657516 5284 ?        Ss   10:00   0:00 lightdb: pg_cron launcher 
zjh      105413  0.0  0.0 6655048 4272 ?        Ss   10:00   0:00 lightdb: pg_wait_sampling collector 
zjh      105414  0.2  0.0 6656512 2684 ?        Ss   10:00   0:01 lightdb: logical replication launcher 
经整体查看,一个backend进程处于debug模式,但是已经收到信号QUIT了,但是gdb尚未断开。断开后,defunct(僵尸)进程就没有了。
原创文章,作者:kirin,如若转载,请注明出处:https://blog.ytso.com/tech/bigdata/244463.html
