pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
AW: broken backup trail in case of quickly patroni switchback and forth
3+ messages / 2 participants
[nested] [flat]

* AW: broken backup trail in case of quickly patroni switchback and forth
@ 2019-11-07 15:18  Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
  1 sibling, 1 reply; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2019-11-07 15:18 UTC (permalink / raw)
  To: Adrian Klaver <adrian.klaver@aklaver.com>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

I already asked the Patroni folks. They told me this is not related to Patroni but Postgresql. ;-)

- Markus



On 11/7/19 5:52 AM, Zwettler Markus (OIZ) wrote:
> we are using Patroni for management of our Postgres standby databases.
> 
> we take our (wal) backups on the primary side based on intervals and thresholds.
> our archived wal's are written to a local wal directory first and moved to tape afterwards.
> 
> we got a case where Patroni switched back and forth sides quickly, e.g.:
> 12:00h: primary - standby
> 12:05h: standby - primary
> 12:10h: primary - standby
> 
> we realised that we will not have a wal backup of those wal's generated between 12:05h and 12:10h in this scenario.
> 
> how can we make sure that the whole wal sequence trail will be backuped? any idea?

Probably best to ask the Patroni folks:

https://github.com/zalando/patroni#community

> 
> - Markus
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com


^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: AW: broken backup trail in case of quickly patroni switchback and forth
@ 2019-11-07 15:25  Adrian Klaver <adrian.klaver@aklaver.com>
  parent: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
  0 siblings, 0 replies; 3+ messages in thread

From: Adrian Klaver @ 2019-11-07 15:25 UTC (permalink / raw)
  To: Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

On 11/7/19 7:18 AM, Zwettler Markus (OIZ) wrote:
> I already asked the Patroni folks. They told me this is not related to Patroni but Postgresql. ;-)

Hard to say without more information:

1) Postgres version

2) Setup/config info

3) Detail if what happened between 12:00 and 12:10

> 
> - Markus
> 
> 
> 
> On 11/7/19 5:52 AM, Zwettler Markus (OIZ) wrote:
>> we are using Patroni for management of our Postgres standby databases.
>>
>> we take our (wal) backups on the primary side based on intervals and thresholds.
>> our archived wal's are written to a local wal directory first and moved to tape afterwards.
>>
>> we got a case where Patroni switched back and forth sides quickly, e.g.:
>> 12:00h: primary - standby
>> 12:05h: standby - primary
>> 12:10h: primary - standby
>>
>> we realised that we will not have a wal backup of those wal's generated between 12:05h and 12:10h in this scenario.
>>
>> how can we make sure that the whole wal sequence trail will be backuped? any idea?
> 
> Probably best to ask the Patroni folks:
> 
> https://github.com/zalando/patroni#community
> 
>>
>> - Markus
>>
>>
> 
> 


-- 
Adrian Klaver
adrian.klaver@aklaver.com





^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* AW: broken backup trail in case of quickly patroni switchback and forth
@ 2019-11-08 11:48  Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
  1 sibling, 0 replies; 3+ messages in thread

From: Zwettler Markus (OIZ) @ 2019-11-08 11:48 UTC (permalink / raw)
  To: Laurenz Albe <laurenz.albe@cybertec.at>; pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

1) If I got you right this means enabling archiving on both machines (archive_mode=on, archive_command=cp...). Yes?

2) Will the latest transactions on the actual primary be archived (copied from pg_xlog to the local archive_directory) before this primary is reinstated as new standby?

Thanks,
Markus



On Thu, 2019-11-07 at 13:52 +0000, Zwettler Markus (OIZ) wrote:
> we are using Patroni for management of our Postgres standby databases.
> 
> we take our (wal) backups on the primary side based on intervals and thresholds.
> our archived wal's are written to a local wal directory first and moved to tape afterwards.
> 
> we got a case where Patroni switched back and forth sides quickly, e.g.:
> 12:00h: primary - standby
> 12:05h: standby - primary
> 12:10h: primary - standby
> 
> we realised that we will not have a wal backup of those wal's generated between 12:05h and 12:10h in this scenario.
> 
> how can we make sure that the whole wal sequence trail will be backuped? any idea?

You'll have to archive WAL from both machines.  Then you have everything you should need.

Make sure "recovery_target_timeline = 'latest'" so that recovery will follow the timeline jumps.

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



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2019-11-08 11:48 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-11-07 15:18 ` Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>
2019-11-07 15:25   ` Adrian Klaver <adrian.klaver@aklaver.com>
2019-11-08 11:48 ` Zwettler Markus (OIZ) <Markus.Zwettler@zuerich.ch>

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