I have two postgresql 11.4
running as master and slave nodes.
I am inserting huge volume of data in master to see it get replicated on the slave. Trying to simulate the following case,
pause_wal_replay
on slaveresume_wal_replay
on slaveIf a promote signal
is issued at this point [ When there are multiple wal - already shipped and waiting to be replayed ], When will slave promote itself?
After replaying all the existing wal files [ shipped and waiting to be replayed
]
or
Immediately after receiving promote signal. [ Without replaying the wal files
waiting - causing data loss
? ]
If it is (1)
, what happens if the master node is still sending wal files and I try to promote the slave. Does it ignore the incoming wal and promote itself?
Hoping PG Experts can shed light on this.
PS : I'm issuing promote signal by creating a 'pg_failover_trigger
' if its worth mentioning.
When it is promoted, the standby server shuts down the WAL receiver process and recovers all remaining WAL it has. So we get the behavior from 1.