From: Daulat Ram <Daulat.Ram@exponential.com>
To: Avinash Kumar <avinash.vallarapu@gmail.com>
To: David Steele <david@pgmasters.net>
Cc: Luca Ferrari <fluca1978@gmail.com>
Cc: Andreas Joseph Krogh <andreas@visena.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: RE: Postgres Point in time Recovery (PITR),
Date: Sat, 19 Oct 2019 17:46:15 +0000
Message-ID: <MN2PR01MB58540CE1040B6FF46B4048109B6F0@MN2PR01MB5854.prod.exchangelabs.com> (raw)
In-Reply-To: <CAN0TujfmLyph4qNLBPqpo5iah7yOo6Vk4FxLFVRBO7eA49dFCQ@mail.gmail.com>
References: <MN2PR01MB5854BEF9884EA942657A18799B6C0@MN2PR01MB5854.prod.exchangelabs.com>
<VisenaEmail.8c.74d96bc312aea0bc.16dddf72933@tc7-visena>
<CAKoxK+7PpV6G16nuXhuUjUN_SNVjUsVM2s5ns_AMUvksgys52A@mail.gmail.com>
<3ff2963f-daab-81d4-ab1a-569fe1c8857b@pgmasters.net>
<CAN0TujfmLyph4qNLBPqpo5iah7yOo6Vk4FxLFVRBO7eA49dFCQ@mail.gmail.com>
Hi All,
Thanks for your suggestions.
One more questions is, how backups are useful if we have streaming replication . As I know, we can promote the standby as primary in case of disaster at primary side. Do we need to schedule backups if we have streaming replication?
Thanks
From: Avinash Kumar <avinash.vallarapu@gmail.com>
Sent: Friday, October 18, 2019 5:28 PM
To: David Steele <david@pgmasters.net>
Cc: Luca Ferrari <fluca1978@gmail.com>; Andreas Joseph Krogh <andreas@visena.com>; Daulat Ram <Daulat.Ram@exponential.com>; pgsql-general@lists.postgresql.org
Subject: Re: Postgres Point in time Recovery (PITR),
Hi Daulat,
PITR entirely depends on what type of backups you choose.
Sometimes, to reduce the amount of downtime involved while restoring and recovering a backup, you may also use a additional delayed standby.
You could use the PG built-in feature to delay the replication and fast-forward it to the safest point to achieve PITR. But this requires you to have an additional standby.
https://www.percona.com/blog/2018/06/28/faster-point-in-time-recovery-pitr-postgresql-using-delayed-...
If you have several TBs of database, pgBackRest is of course a way to go for backups (there are few more open source solutions), but also consider the amount of time it takes for recovery. Keeping all of this in mind, your approach to PITR changes.
So i would ask you this question, what is the backup tool you use and what is your backup strategy ? Are you taking a physical backup and performing continuous archiving of WALs ? The answer to your question entirely depends on this. :)
Regards,
Avinash Vallarapu.
On Fri, Oct 18, 2019 at 5:17 PM David Steele <david@pgmasters.net<mailto:david@pgmasters.net>> wrote:
On 10/18/19 11:29 AM, Luca Ferrari wrote:
> On Fri, Oct 18, 2019 at 10:30 AM Andreas Joseph Krogh
> <andreas@visena.com<mailto:andreas@visena.com>> wrote:
>> We use barman (https://www.pgbarman.org/) for continuous streaming backup and I had to restore from it once, and it went like this:
>
> Just for the records, here's an example of restore with pgbackrest:
>
> % sudo -u postgres pgbackrest --stanza=miguel \
> --log-level-console=info --delta restore
> ...
> INFO: restore backup set 20190916-125652F
> INFO: remove invalid files/paths/links from /postgres/pgdata/11
> INFO: cleanup removed 148 files, 3 paths
> ...
> INFO: write /postgres/pgdata/11/recovery.conf
> INFO: restore global/pg_control (performed last
> to ensure aborted restores cannot be started)
> INFO: restore command end: completed successfully (5113ms)
pgBackRest also has a tutorial on PITR:
https://pgbackrest.org/user-guide.html#pitr
--
-David
david@pgmasters.net<mailto:david@pgmasters.net>
--
9000799060
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: Daulat.Ram@exponential.com, avinash.vallarapu@gmail.com, david@pgmasters.net, fluca1978@gmail.com, andreas@visena.com
Subject: Re: Postgres Point in time Recovery (PITR),
In-Reply-To: <MN2PR01MB58540CE1040B6FF46B4048109B6F0@MN2PR01MB5854.prod.exchangelabs.com>
References: <MN2PR01MB5854BEF9884EA942657A18799B6C0@MN2PR01MB5854.prod.exchangelabs.com> <VisenaEmail.8c.74d96bc312aea0bc.16dddf72933@tc7-visena> <CAKoxK+7PpV6G16nuXhuUjUN_SNVjUsVM2s5ns_AMUvksgys52A@mail.gmail.com> <3ff2963f-daab-81d4-ab1a-569fe1c8857b@pgmasters.net> <CAN0TujfmLyph4qNLBPqpo5iah7yOo6Vk4FxLFVRBO7eA49dFCQ@mail.gmail.com> <MN2PR01MB58540CE1040B6FF46B4048109B6F0@MN2PR01MB5854.prod.exchangelabs.com>
* 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