1

我正在使用 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

现在从站与主站同步,但校验和条目仍然存在。我检查的另一件事是网络日志-> 网络可用。

我的问题是:

  1. 有谁知道为什么 walreceiver 被终止了?
  2. 为什么 PostgreSQL 不重试复制?
  3. 我能做些什么来防止这种情况在未来发生?

谢谢你。

编辑:

数据库服务器在带有 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 并且一切都会顺利吗?

4

2 回答 2

1

万一有人偶然发现这个问题,我最终从备份数据重新安装数据库并再次设置复制。从来没有真正弄清楚出了什么问题。

于 2016-12-05T13:12:56.733 回答
1

从来没有真正弄清楚出了什么问题。

我遇到了同样的错误——只是它从一开始就没有完全同步。

然后,主服务器出现了一些内核错误(服务器机箱发热问题?)。由于关闭不完整,需要关闭服务器。已经在关闭时,奴隶出现了

LOG:  incorrect resource manager data checksum in record at 1/63663CB0

在主服务器重启和从服务器重启后,情况并没有改变:每 5 秒有相同的日志条目。

于 2017-04-27T08:58:51.673 回答