我们刚刚成功地将主服务器备份到热备用服务器上。但是,当我们尝试查询热备时,我们会收到以下错误:
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