暂无图片
暂无图片
暂无图片
暂无图片
暂无图片

Windows 环境下电脑强制关机导致 PG 服务停止与pg_ctl stop -mi 方式强制停止PG差异

原创 岳麓丹枫 2024-12-02
102

现象

  1. 停库超时
<2024-11-29 12:50:43.022 UTC 87472 192.167.60.1(54862) PostgreSQL JDBC Driver postgres stk>FATAL: terminating connection due to administrator command <2024-11-29 12:50:43.022 UTC 108724 127.0.0.1(58913) PostgreSQL JDBC Driver postgres vehiclerecognize>FATAL: terminating connection due to administrator command ... 2024-11-29 12:50:43.022 UTC 75724 127.0.0.1(55169) PostgreSQL JDBC Driver postgres foundation>FATAL: terminating connection due to administrator command <2024-11-29 12:50:43.072 UTC 69504 >FATAL: terminating autovacuum process due to administrator command <2024-11-29 12:50:43.449 UTC 88328 127.0.0.1(60033) [unknown] postgres foundation>FATAL: the database system is shutting down <2024-11-29 12:50:43.494 UTC 90688 127.0.0.1(60034) [unknown] postgres accesscontrol>FATAL: the database system is shutting down <2024-11-29 12:50:43.727 UTC 109536 127.0.0.1(60035) [unknown] postgres foundation>FATAL: the database system is shutting down ... <2024-11-29 12:51:04.833 UTC 92964 127.0.0.1(60291) [unknown] [unknown] [unknown]>LOG: wrong key in cancel request for process 0 <2024-11-29 12:51:04.900 UTC 106280 127.0.0.1(60292) [unknown] postgres attendance>FATAL: the database system is shutting down <2024-11-29 12:51:05.156 UTC 100548 127.0.0.1(60293) [unknown] postgres foundation>FATAL: the database system is shutting down <2024-11-29 12:51:05.366 UTC 84108 127.0.0.1(60294) [unknown] [unknown] [unknown]>LOG: PID 99480 in cancel request did not match any process ... <2024-11-29 12:56:43.887 UTC 78360 127.0.0.1(64920) [unknown] [unknown] [unknown]>LOG: wrong key in cancel request for process 0 <2024-11-29 12:56:43.931 UTC 109516 127.0.0.1(64921) [unknown] postgres imos_lda>FATAL: the database system is shutting down <2024-11-29 12:56:43.933 UTC 88528 >LOG: shutting down <2024-11-29 12:56:44.175 UTC 108644 127.0.0.1(64922) [unknown] [unknown] [unknown]>LOG: wrong key in cancel request for process 0 <2024-11-29 12:56:44.219 UTC 100096 127.0.0.1(64923) [unknown] postgres imos_lda>FATAL: the database system is shutting down <2024-11-29 12:56:44.269 UTC 103412 127.0.0.1(64958) [unknown] postgres accesscontrol>FATAL: the database system is shutting down <2024-11-29 12:56:44.304 UTC 99748 127.0.0.1(64959) [unknown] postgres foundation>FATAL: the database system is shutting down <2024-11-29 12:56:44.467 UTC 84828 127.0.0.1(64960) [unknown] [unknown] [unknown]>LOG: wrong key in cancel request for process 0 <2024-11-29 12:56:44.501 UTC 98716 127.0.0.1(64961) [unknown] postgres uap>FATAL: the database system is shutting down <2024-11-29 12:56:44.577 UTC 92348 127.0.0.1(64962) [unknown] postgres attendance>FATAL: the database system is shutting down

在这里插入图片描述

默认超时限制为 60s在这里插入图片描述

pg_ctl stop       [-D DATADIR] [-m SHUTDOWN-MODE] [-W] [-t SECS] [-s]
- t seconds
-- timeout=seconds
Specifies the maximum number of seconds to wait when waiting for an operation to complete (see option `-w`). Defaults to the value of the `PGCTLTIMEOUT` environment variable or, if not set, to 60 seconds.

停库底层流程

在这里插入图片描述
在这里插入图片描述

参考: https://postgres-howto.cn/#/./docs/2?id=%e6%80%bb%e7%bb%93

「喜欢这篇文章,您的关注和赞赏是给作者最好的鼓励」
关注作者
【版权声明】本文为墨天轮用户原创内容,转载时必须标注文章的来源(墨天轮),文章链接,文章作者等基本信息,否则作者和墨天轮有权追究责任。如果您发现墨天轮中有涉嫌抄袭或者侵权的内容,欢迎发送邮件至:contact@modb.pro进行举报,并提供相关证据,一经查实,墨天轮将立刻删除相关内容。

评论