I'm searching for HA solutions without load balancing in the master-slave model, using postgresql. My favorite solution so far is log shipping synchronous replication. But I have one main concern, and that is, if my slave server becomes unavailable, will my master server continue it's operation? Or will it wait for the acknowledgment of my slave server until it's up again?
Asked
Active
Viewed 127 times
2 Answers
1
If you have only one standby, the master will halt ( by design ).
The master will still serve read-only statements, but all writes will be blocked until the standby comes back.
You can avoid this scenario by providing multiple candidates in synchronous_standby_names
.
See SYNCHRONOUS-REPLICATION in the PostgreSQL Docs.

Thomas Berger
- 1,860
- 13
- 26
-
That's unfortunate to hear! Because I only have 2 servers. so I guess that the best solution for me is to use asynchronous streaming log shipping. Or is there a better way? – Amir Masoud Mostofinejad Jul 25 '18 at 11:09
-
You always can add pg_receivexlog/pg_receivewal as an syncrhonous standby, so you can make sure that: all wals are backed up on a crash and the master runs without a "real" standby – Thomas Berger Jul 25 '18 at 11:22
-
I didn't get your sayings... can you explain a bit more? – Amir Masoud Mostofinejad Jul 25 '18 at 11:27
-
If you want to use synchronous replication with only two nodes, you can use the tool `pg_recivewal` ( or `pg_recivexlog` in older versions ) as a synchronous standby. See the linked documentation how to do that. – Thomas Berger Jul 25 '18 at 11:41
0
I found another way to prevent the master halt at slave crash. We can use wal_sender_timeout
in masters postgresql.conf
file to disconnect from the slave if it's been crashed.