Hi,
We are using PostgreSQL 10.1 and OS is Ubuntu 16.04.3 LTS, for primary as well as secondary database server.
We are using streaming replication (asynchronous). But there is frequent replication connection break between primary and secondary.
Database Log at Primary:
14:46:11.610
IST
LOG: unexpected EOF on standby connection
14:46:11.610
IST
LOG: disconnection: session time: 2:59:34.520 user=replication_user
Database Log at Secondary
14:46:38.822 IST FATAL: terminating walreceiver due to timeout
After replication disconnection, secondary get connected after approximately 25 seconds. We want to set synchronous replication, but because of this issue we can't do that.
I have enabled debug5 log, but I didn't understand much from that. I am attaching the same.
Below are the config parameter
Primary
wal_level = replica
max_wal_senders = 10
wal_keep_segments = 300
wal_sender_timeout = 60s
checkpoint_timeout = 5min
max_wal_size = 1GB
min_wal_size = 80MB
Secondary
hot_standby = on
wal_receiver_timeout = 30s
Below are the issues.
1. Because of what reason, " unexpected EOF on standby connection" occurs on primary db server?
2. After replication disconnection, secondary should immediately connect to primary, but it takes some time, what could be the reason for this?
Any help will be highly appreciated.
Thanks & Regards,
Ganesh.
Attachment:
Primary_replication_user.log
Description: Binary data
<<attachment: Secondary.zip>>