lightdb停不掉FATAL: the database system is shutting down

2022-04-22 05:30:48.790022C lt_recvlogical zjh@postgres [local] walsender idle 55006[2022-04-22 05:30:48 UTC] 0 [201020] ERROR: replication slot "test_for_recvlogical" is active for PID 178953
2022-04-22 05:30:53.799190C lt_recvlogical zjh@postgres [local] walsender idle 55006[2022-04-22 05:30:53 UTC] 0 [201039] ERROR: replication slot "test_for_recvlogical" is active for PID 178953
2022-04-22 05:30:55.549007C @ postmaster 00000[2022-04-16 11:14:13 UTC] 0 [162748] LOG: received fast shutdown request
2022-04-22 05:30:55.549180C @ postmaster 00000[2022-04-16 11:14:13 UTC] 0 [162748] LOG: aborting any active transactions
2022-04-22 05:30:55.549288C @ pg_wait_sampling collector 00000[2022-04-16 11:35:13 UTC] 0 [174802] LOG: pg_wait_sampling collector shutting down
2022-04-22 05:30:55.549294C @ pg_cron launcher 57P01[2022-04-16 11:35:13 UTC] 0 [174801] FATAL: terminating connection due to administrator command
2022-04-22 05:30:55.550215C @ postmaster 00000[2022-04-16 11:14:13 UTC] 0 [162748] LOG: background worker "logical replication launcher" (PID 174803) exited with exit code 1
2022-04-22 05:30:55.550532C @ postmaster 00000[2022-04-16 11:14:13 UTC] 0 [162748] LOG: background worker "pg_cron launcher" (PID 174801) exited with exit code 1
2022-04-22 05:30:58.804144C [unknown] zjh@postgres [local] walsender 57P03[2022-04-22 05:30:58 UTC] 0 [201060] FATAL: the database system is shutting down
2022-04-22 05:31:03.805628C [unknown] zjh@postgres [local] walsender 57P03[2022-04-22 05:31:03 UTC] 0 [201095] FATAL: the database system is shutting down
2022-04-22 05:31:08.808845C [unknown] zjh@postgres [local] walsender 57P03[2022-04-22 05:31:08 UTC] 0 [201114] FATAL: the database system is shutting down
2022-04-22 05:31:13.814499C [unknown] zjh@postgres [local] walsender 57P03[2022-04-22 05:31:13 UTC] 0 [201135] FATAL: the database system is shutting down
2022-04-22 05:31:18.820607C [unknown] zjh@postgres [local] walsender 57P03[2022-04-22 05:31:18 UTC] 0 [201158] FATAL: the database system is shutting down

pstack可以发现进程这个时候空闲。如下:

[zjh@hs-10-20-30-193 bin]$ lsof -i:25432
COMMAND    PID USER   FD   TYPE    DEVICE SIZE/OFF NODE NAME
lightdb 162748  zjh    7u  IPv4 110347055      0t0  TCP *:25432 (LISTEN)
lightdb 162748  zjh    8u  IPv6 110347056      0t0  TCP *:25432 (LISTEN)
[zjh@hs-10-20-30-193 bin]$ pstack 162748
#0  0x00007ff55c1b0a13 in __select_nocancel () from /lib64/libc.so.6
#1  0x0000000000845a3e in ServerLoop () at postmaster.c:1923
#2  0x000000000084508c in PostmasterMain (argc=3, argv=0xde7ef0) at postmaster.c:1495
#3  0x0000000000753bff in main (argc=3, argv=0xde7ef0) at main.c:231
[zjh@hs-10-20-30-193 bin]$ pstack 162748
#0  0x00007ff55c1b0a13 in __select_nocancel () from /lib64/libc.so.6
#1  0x0000000000845a3e in ServerLoop () at postmaster.c:1923
#2  0x000000000084508c in PostmasterMain (argc=3, argv=0xde7ef0) at postmaster.c:1495
#3  0x0000000000753bff in main (argc=3, argv=0xde7ef0) at main.c:231

即使是--mode=immediate模式,也无法停止。原因是有个standby复制槽被一个进程walsender占用着,可以直接杀掉lightdb进程重启。然后重启lightdb即可。如果standby端不是重试模式,就可以了。如果是重试模式,需要把standby先停止。

posted @ 2022-04-22 13:56  zhjh256  阅读(405)  评论(0编辑  收藏  举报