2017-09-23 61 views
4

,因热备服务器上的只读查询失败,我们只是成功将一个主服务器备份到热备服务器上。然而,当我们试图查询到双机热备,我们得到以下错误:由于获取事务标识

ERROR: cannot assign TransactionIds during recovery 

我启用详细模式,并看到varsup.c出现错误:72

/* safety check, we should never get this far in a HS standby */ 
if (RecoveryInProgress()) 
    elog(ERROR, "cannot assign TransactionIds during recovery"); 

奇怪的是,如果我们使用psql客户端并发出多个读取查询,第一个将失败,但所有后续的将成功。

pipeline=# SELECT pg_is_in_recovery(); 
ERROR: cannot assign TransactionIds during recovery 
pipeline=# SELECT pg_is_in_recovery(); 
pg_is_in_recovery 
------------------- 
t 
(1 row) 

使用的Postgres 9.5.3

任何想法将不胜感激它。

BTW: 我们增加了: hot_standby = on到pipelinedb.conf(相当于postgresql.conf中)

和我们说:

primary_slot_name = 'replicator_slot' 
primary_conninfo = 'user=username host=ip_address port=5432' 
recovery_target_timeline = 'latest' 

到的recovery.conf

回答

1

我们正在调查the issue你这么写若有所思为我们。我会在这里发布一个更新,一旦它解决了,应该不会很长

0

使用

pg_ctl promote 

退出recove ry模式并恢复正常(读/写)操作。

postgresql documentation

In promote mode, the standby server that is running in the specified 
data directory is commanded to exit recovery and begin read-write 
operations. 
+0

感谢提示保罗,但我们不希望热备用退出恢复。理想情况下,它始终处于恢复状态,并帮助主/主机运行只读查询。 –