PostgreSQL数据中`pg_logical`目录的用途是什么?

时间:2014-09-22 10:52:30

标签: postgresql repmgr

我在测试我设置的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/snapshots dir实际上存在于主节点上,它是空的。

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

1 个答案:

答案 0 :(得分:3)

new logical changeset extraction / logical replication feature in 9.4

这不应该发生,但是......它暗示了一个重要的错误,可能是repmgr。我等待细节(repmgr版本等)。

更新:已确认,it's a repmgr bug。它已经在git master中修复(并且在本报告之前)并将在下一个版本中修复。考虑到这个问题的重要性,哪个最好很快。