On Wed, Aug 05, 2020 at 06:36:15PM +0000, Mariya Rampurawala wrote:
> What I want to understand is that, in case of replication link
> failure, there will still be inserts happening at the master
> node. In that case, how will the slave know if it is up-to-date?
It cannot do that by itself, which is why in common HA scenarios you
have a witness host that acts as a monitoring instance for the primary
and the standby so as you limit SPOF issues. This depends of course
on your application requirements, but you can also leverage things
by using a replication lag in bytes on the primary, and even couple
that with synchronous replication to check when commits are getting
blocked.
IMO, I think that you should try to not reinvent the wheel and use one
of the solutions provided by the community, pg_auto_failover coming
into my mind as one solution for example.
--
Michael