5

我刚刚在测试我设置的 PostgreSQL 9.4 集群的故障转移时偶然发现了这个错误。在这里,我试图将奴隶提升为新主人:

$ repmgr -f /etc/repmgr/repmgr.conf --verbose standby promote

2014-09-22 10:46:37 UTC LOG:  database system shutdown was interrupted; last known up at 2014-09-22 10:44:02 UTC
2014-09-22 10:46:37 UTC LOG:  database system was not properly shut down; automatic recovery in progress
2014-09-22 10:46:37 UTC LOG:  redo starts at 0/18000028
2014-09-22 10:46:37 UTC LOG:  consistent recovery state reached at 0/19000600
2014-09-22 10:46:37 UTC LOG:  record with zero length at 0/1A000090
2014-09-22 10:46:37 UTC LOG:  redo done at 0/1A000028
2014-09-22 10:46:37 UTC LOG:  last completed transaction was at log time 2014-09-22 10:36:22.679806+00
2014-09-22 10:46:37 UTC FATAL:  could not open directory "pg_logical/snapshots": No such file or directory
2014-09-22 10:46:37 UTC LOG:  startup process (PID 2595) exited with exit code 1
2014-09-22 10:46:37 UTC LOG:  aborting startup due to startup process failure

pg_logical/snapshotsdir 实际上存在于主节点上,它是空的。

UPD:我刚刚手动创建了空目录pg_logical/snapshotspg_logical/mappings并且服务器已经启动而没有抱怨。repmgr standby clone同步时似乎省略了这个目录。但是问题仍然存在,因为我只是好奇这个目录的用途,也许我在设置中遗漏了一些东西。简单地谷歌搜索它并没有产生任何有意义的结果。

4

1 回答 1

3

它用于9.4 中新的逻辑变更集提取/逻辑复制功能

但是,这不应该发生……它表明某处存在重大错误,可能是repmgr。我将等待详细信息(repmgr 版本等)。

更新:确认,这是一个 repmgr 错误。它已经在 git master 中修复(并且在本报告之前),并将在下一个版本中。鉴于这个问题的重要性,最好尽快。

于 2014-09-22T12:33:32.283 回答