我正在使用 PostgreSQL 9.1(1 个主设备,3 个从设备)运行流复制环境。aprox 一切正常。2个月。昨天,复制到其中一个从属服务器失败,从属服务器上的日志具有:
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
FATAL: terminating walreceiver process due to administrator command
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
从站不再与主站同步。两个小时后,其中日志每 5 秒出现一个新行,如上所示,我重新启动了从数据库服务器:
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: received fast shutdown request
LOG: aborting any active transactions
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
FATAL: terminating connection due to administrator command
FATAL: terminating connection due to administrator command
LOG: shutting down
LOG: database system is shut down
从站上的新日志文件包含:
LOG: database system was shut down in recovery at 2016-02-29 05:12:11 CET
LOG: entering standby mode
LOG: redo starts at 61/D92C10C9
LOG: consistent recovery state reached at 61/DA2710A7
LOG: database system is ready to accept read only connections
LOG: incorrect resource manager data checksum in record at 61/DA2710A7
LOG: streaming replication successfully connected to primary
现在从站与主站同步,但校验和条目仍然存在。我检查的另一件事是网络日志-> 网络可用。
我的问题是:
- 有谁知道为什么 walreceiver 被终止了?
- 为什么 PostgreSQL 不重试复制?
- 我能做些什么来防止这种情况在未来发生?
谢谢你。
编辑:
数据库服务器在带有 ext3 的 SLES 11 上运行。我发现了一篇关于大 RAM 的 SLES 11 性能低下的文章,但我不确定它是否适用,因为我的机器只有 8 GB RAM ( https://www.novell.com/support/kb/doc.php?id= 7010287 )
任何帮助,将不胜感激。
编辑(2):
PostgreSQL 版本是 9.1.5。似乎 PostgreSQL 版本 9.1.6 提供了类似问题的修复?
Fix persistence marking of shared buffers during WAL replay (Jeff Davis)
This mistake can result in buffers not being written out during checkpoints, resulting in data corruption if the server later crashes without ever having written those buffers. Corruption can occur on any server following crash recovery, but it is significantly more likely to occur on standby slave servers since those perform much more WAL replay.
来源:http ://www.postgresql.org/docs/9.1/static/release-9-1-6.html
这可能是解决办法吗?我应该升级到 PostgreSQL 9.1.6 并且一切都会顺利吗?