PostgreSQL停止动作观察
2024-10-10 21:56:20
实验过程如下:
启动一个客户端:
[postgres@cnrd56 bin]$ ./psql
psql (9.1.2)
Type "help" for help. postgres=# begin;
BEGIN
postgres=# select count(*), pg_sleep(1000) from test;
然后强制停止:
pg_ctl stop -m f -D /usr/local/pgsql/data
此时在客户端出现如下信息:
FATAL: terminating connection due to administrator command
The connection to the server was lost. Attempting reset: Failed.
!>
再看后台的log:
2013-07-14 10:17:17.280 CST,,,3422,,51e209eb.d5e,2,,2013-07-14 10:16:11 CST,,0,LOG,00000,"received fast shutdown request",,,,,,,,,""
2013-07-14 10:17:17.280 CST,,,3422,,51e209eb.d5e,3,,2013-07-14 10:16:11 CST,,0,LOG,00000,"aborting any active transactions",,,,,,,,,""
2013-07-14 10:17:17.280 CST,,,3427,,51e209ec.d63,2,,2013-07-14 10:16:12 CST,1/0,0,LOG,00000,"autovacuum launcher shutting down",,,,,,,,,""
2013-07-14 10:17:17.280 CST,"postgres","postgres",3431,"[local]",51e209ff.d67,1,"SELECT",2013-07-14 10:16:31 CST,2/2,0,FATAL,57P01,"terminating connection due to administrator command",,,,,,"select count(*), pg_sleep(1000) from test;",,,"psql"
2013-07-14 10:17:17.281 CST,,,3425,,51e209ec.d61,1,,2013-07-14 10:16:12 CST,,0,LOG,00000,"shutting down",,,,,,,,,""
2013-07-14 10:17:17.281 CST,"postgres","postgres",3435,"[local]",51e20a2d.d6b,1,"",2013-07-14 10:17:17 CST,,0,FATAL,57P03,"the database system is shutting down",,,,,,,,,""
2013-07-14 10:17:17.284 CST,,,3425,,51e209ec.d61,2,,2013-07-14 10:16:12 CST,,0,LOG,00000,"database system is shut down",,,,,,,,,""
其中的:
2013-07-14 10:17:17.280 CST,"postgres","postgres",3431,"[local]",51e209ff.d67,1,"SELECT",2013-07-14 10:16:31 CST,2/2,0,FATAL,57P01,"terminating connection due to administrator command",,,,,,"select count(*), pg_sleep(1000) from test;",,,"psql"
表明,客户端正在执行sql文 select count(*), pg_sleep(1000) from test的时候,
收到了 "terminating connection due to administrator command" 命令。
最新文章
- 学习笔记-Java编程思想
- jQuery将悬停效果加到菜单项
- Asp.net Ibatis 增、删、改、查
- Uva10635 LCS
- TortoiseGit 连接每次都要输入用户名和密码
- C#.net时间戳转换
- Box model小心得
- STL中istream_iterator和ostream_iterator的基本用法
- web之ios开关按钮
- Sublime 插件安装、常用配置
- React的学习(下)
- swift3.0 coreData的使用-日记本demo
- JS网页特效操作流程——下拉菜单列表与登录注册弹窗效果
- 【Uva10559】Blocks(区间DP)
- [SHOI2012]随机树
- 框架中的导航框架 &; position定位
- Orleans学习总结(四)--集群配置篇
- ElasticSearch 从零到入门
- 好用的firefox浏览器、geckodriver驱动的版本组合(55 和 0.19.1)
- cocos2dx 3.13 simulator的问题