由于获取事务ID,热备用服务器上的只读查询失败

时间:2017-09-23 01:19:56

标签: replication pipelinedb

我们刚刚成功将主服务器备份到热备用服务器上。但是,当我们尝试查询热备用时,我们收到以下错误:

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

任何想法都会非常感激。

顺便说一句: 我们已添加: 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

2 个答案:

答案 0 :(得分:1)

我们目前正在调查the issue你如此仔细地为我们写的。我会在解决后发布更新,这不应该很长

答案 1 :(得分:0)

使用

pg_ctl promote

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

来自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.