我在 Windows Server 上运行了一些处于连续恢复模式的 Postgresql 10 实例。偶尔他们只是停止恢复而没有给出任何错误,就像在这个示例日志文件中一样(在 CSV 格式中,为了清楚起见,我删除了一些字段):
2022-08-23 19:42:02.391,"restored log file ""000000010000029F0000001A"" from archive"
2022-08-23 19:42:07.638,"restored log file ""000000010000029F0000001B"" from archive"
2022-08-23 19:42:13.276,"restored log file ""000000010000029F0000001C"" from archive"
2022-08-23 19:42:18.464,"restored log file ""000000010000029F0000001D"" from archive"
2022-08-23 19:42:18.699,"redo done at 29F/1CFFF7F8"
2022-08-23 19:42:18.708,"last completed transaction was at log time 2022-07-20 12:49:38.247406-03"
2022-08-23 19:42:24.304,"restored log file ""000000010000029F0000001C"" from archive"
2022-08-23 19:42:48.625,"selected new timeline ID: 2"
2022-08-23 19:43:13.718,"archive recovery complete"
2022-08-23 19:43:27.746,"database system is ready to accept connections"
即使归档目录中存在序列中要恢复的下一个 wal 文件(000000010000029F0000001D,000000010000029F0000001E),也会发生这种情况。我正在使用的恢复命令是这样的:
restore_command = '"C:/program files/postgresql/10/bin/pg_standby.exe" -s 2 D:/archive/127 %f %p %r 2>>D:/archive/127/pg_standby.log'
我的问题是,有什么方法可以找出导致实例停止恢复的原因吗?