0

我有一个发布者和一个订阅者。我经常得到:

ERROR:  could not receive data from WAL stream: server closed the connection unexpectedly
This probably means the server terminated abnormally before or while processing the request.

我可以猜到为什么它异常终止,其中一台计算机关闭。但是,当两台计算机再次连接时,它不会自动重启。

唯一可行的方法是截断订阅中的所有表,删除订阅和发布,然后再次创建订阅和发布。

我试着看看 WAL,它们非常好。不知道该怎么做。

以下是一些图片:

子表的东西 酒吧桌的东西 子日志 发布日志

4

1 回答 1

0

It should not be necessary to re-initialize logical replication just because there was a connection problem. The logical replication slot on the primary will make sure that all required information is retained on the server so that replication can be resumed later on.

Reading you primary log, it looks like you are just hitting a timeout because there is nothing to replicate. That shouldn't be a problem, but you can set wal_sender_timeout = 0 on the primary to disable the timeout.

于 2019-05-16T06:26:37.883 回答