Thread: Automatic failover

Automatic failover

From
Sonam Sharma
Date:
I have setup replication using repmgr. Wanted to know how much time the slave node will take to become new primary ?? If any document, can someone please share of auto failover.  With automatic failover, how much time the slave takes to become new primary .
Thanks..

Re: Automatic failover

From
Paul Foerster
Date:
Hi Sonam,

On Tue, Mar 17, 2020 at 11:30 AM Sonam Sharma <sonams1209@gmail.com> wrote:
>
> I have setup replication using repmgr. Wanted to know how much time the slave node will take to become new primary ??
Ifany document, can someone please share of auto failover.  With automatic failover, how much time the slave takes to
becomenew primary . 
> Thanks..

I don't know about repmgr. We use Patroni with etcd. A switchover
takes only a second or two with that. And the (new) replica is usually
in sync again in less than about 5 seconds or so.

Cheers,
Paul



Re: Automatic failover

From
Ian Barwick
Date:
On 2020/03/17 19:30, Sonam Sharma wrote:
 > I have setup replication using repmgr. Wanted to know how much time
 > the slave node will take to become new primary ?? If any document,
 > can someone please share of auto failover.  With automatic failover,
 > how much time the slave takes to become new primary .

It's impossible to give a generic answer to this.

Firstly, there will be the interval between the primary failing and whatever
failover system you are using deciding to make a failover decision. This will
be configurable, and will always be a trade-off between speed and certainty.
Secondly it will depend on what work the standby needs to do before it completes
the promotion process. Typically the standby will promote very quickly, but e.g.
if it has a bunch of WAL to replay first, the process will take longer.


Regards

Ian Barwick


-- 
Ian Barwick                   https://www.2ndQuadrant.com/
  PostgreSQL Development, 24x7 Support, Training & Services