我正在运行 PostgreSQL 9.6.3 的 RDS 实例:select version();返回PostgreSQL 9.6.3 on x86_64-pc-linux-gnu [...]。
我发现在从 RDS 控制台发出停止命令并启动后,数据库总是报告数据库系统没有正确关闭,需要恢复。此行为已由至少一位其他 RDS PostgreSQL 用户 ( https://forums.aws.amazon.com/message.jspa?messageID=809401#809401 )独立验证。
查询
select name, setting
from pg_settings
where name in ('fsync', 'wal_sync_method', 'synchronous_commit');
Run Code Online (Sandbox Code Playgroud)
报告说fsync = on,wal_sync_method = fdatasync(适用于 Linux 系统),和synchronous_commit = on。
发出停止命令后,我在日志中看到以下内容:
2017-10-12 16:37:36 UTC::@:[3464]:LOG: received fast shutdown request
2017-10-12 16:37:36 UTC::@:[3464]:LOG: aborting any active transactions
2017-10-12 16:37:36 UTC::@:[3515]:LOG: autovacuum launcher shutting down
2017-10-12 16:37:36 UTC::@:[3512]:LOG: shutting down
2017-10-12 16:37:36 …Run Code Online (Sandbox Code Playgroud)