Re: PostgreSQL replication failover

From: Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>
To: Jan Peters <haseningo(at)gmx(dot)de>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL replication failover
Date: 2021-01-13 11:25:35
Message-ID: 976875a5adf1c1cda0d55e6da0313f30dc8059f6.camel@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, 2021-01-13 at 09:27 +0100, Jan Peters wrote:
> we are running postgresqlserver on s390 zLinux machines. The distribution
> is RedHat 7 and RedHat 8, so we do not have the many x86 tools available.
>
> We always run 2 instances with a replication (streaming) async mode, the replica
> is in hot_standby and we use it for read-only accesses. About the setup we have the following question:
>
> How is an orderly failover accomplished? Our current procedure is.
>
> 1. primary stop
> 2. promote replica to primary
> 3. create standby.signal on old primary
> 4. change primary_conninfo on old primary
> 5. start old primary as new replica
>
> Is this processing correct? Are there any other steps that simplify a failover?
> How can we be sure that all changes have been transferred from the old master to the replica?

What you describe is not a failover, but a switchover.

If you shut down the primary server cleanly, all changes will be replicated,
so you should be good.

During a failover, that is, if the primary suddenly fails, there is always
the possibility that you lose some transactions, unless you use synchronous
replication.

Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Pepe TD Vo 2021-01-13 13:24:03 Re: PostgreSQL replication failover
Previous Message Jan Peters 2021-01-13 08:27:59 PostgreSQL replication failover