I have my master and slave server in sync.
I have stopped the slave server and tried to perform insert query in master server. The execution is in progress and doesn't give any error message. There is no proper information in logs.
I understand that in synchronous replication master waits for slave to reply but:
- Is there anyway to avoid master server being halted?
- I have stopped my master server and checked the logs that data is locally committed, is this the behaviour of synchronous replication? commit should not work until all data is committed to master and standby?
Best Answer
In synchronous mode, your primary needs to wait for the result to be acknowledged by the secondary to answer.
From the documentation (links below):
That's why, except for someone who can afford downtime (it happens and it's not so rare), we add other asynchronous secondaries that can become synchronous secondaries if needed.
You'll may find useful to read that documentation page : https://www.postgresql.org/docs/current/static/warm-standby.html#SYNCHRONOUS-REPLICATION