From: Laurenz Albe <laurenz.albe@cybertec.at>
To: Martín Fernández <fmartin91@gmail.com>
To: pgsql-generallists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: Promote replica before being able to accept connections
Date: Mon, 11 Feb 2019 11:55:24 +0100
Message-ID: <950236c827942575381949675e8ad709a38ca771.camel@cybertec.at> (raw)
In-Reply-To: <CAH0BA3n6=ocXO9T8D5HXnGMMmN838LfKmvCDpMTJZJf2dx3wAg@mail.gmail.com>
References: <CAH0BA3n6=ocXO9T8D5HXnGMMmN838LfKmvCDpMTJZJf2dx3wAg@mail.gmail.com>
Martín Fernández wrote:
> We have a 9.2 pg cluster and we are in the process of rebuilding a master database in our staging environment.
> In order to achieve the latter goal, we are restoring our staging database using pg_basebackup against one
> of our production replicas.
>
> pg_basebackup has completed and the staging database is configured in hot_standby mode, recovering from
> the WAL archive. The database has not reached the point were it can accept connections yet, still
> investing WAL files.
>
> What we are not sure about is, can we attempt promoting the database as a master instance before it can
> accept connections ? We don´t care if the staging database is a few days behind the production environment,
> that is something acceptable in our use case, we just want to promote it as soon as we can.
The earliest time to which you can recover is the end of the backup.
Until recovery has reached that point, the database is not consistent
(that's the "consistent recovery state" the logs are talking about).
You cannot connect to the recovering database or promote it before you
reach that point, so you have to wait until you can connectio to the database
before you can promote it.
Yours,
Laurenz Albe
--
Cybertec | https://www.cybertec-postgresql.com
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-general@postgresql.org
Cc: laurenz.albe@cybertec.at, fmartin91@gmail.com
Subject: Re: Promote replica before being able to accept connections
In-Reply-To: <950236c827942575381949675e8ad709a38ca771.camel@cybertec.at>
References: <CAH0BA3n6=ocXO9T8D5HXnGMMmN838LfKmvCDpMTJZJf2dx3wAg@mail.gmail.com> <950236c827942575381949675e8ad709a38ca771.camel@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox