pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Laurenz Albe <laurenz.albe@cybertec.at>
To: magodo <wztdyl@sina.com>
To: pgsql-general@postgresql.org
Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
Date: Thu, 11 Oct 2018 06:35:06 +0200
Message-ID: <ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.camel@cybertec.at> (raw)
In-Reply-To: <41a74e2ac23015149bc98631b8dcac0fdb6b6a51.camel@sina.com>
References: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com>
	<0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at>
	<c73ac63988c2a162b9842ad7b5d394387c3703a1.camel@sina.com>
	<34d85bfc77e9a63890e28ea13953c30508233469.camel@cybertec.at>
	<41a74e2ac23015149bc98631b8dcac0fdb6b6a51.camel@sina.com>

magodo wrote:
> OK... Just take another example:
> 
>          A     B
> BASE-----+-----+------o1 (recover to A)                              1
>          |     |           C
>          +.....|.......----+---o2 (regret, recover to B)             2
>                |           |    
>                +...........|..------o3 (regret again, recover to C)  3
>                            | 
>                            +........----                             4
> 
> 
> Suppose I'm at "o3" and want to recover to point "C". Because I want to
> recover to the first timeline which covers this time point, it means I
> wish to recover to timeline 2.

Ah, I finally understand your question.

You assume tht timeline 1 and 2 have ended (that's how you drew it),
and that consequently timeline 3 is the "earliest existing" timeline,
so why doesn't PostgreSQL choose that one automatically?

Even though you drew it that way, timeline 1 and 2 have not ended, in
a way.  There may be more on them.  How should PostgreSQL know what is
the last WAL entry on a certain timeline?  For that, it would have to
restore and examine *all* WAL segments on that timeline until that fails.

But that is unreasonable because of the potential amount of time
and work involved.  Rather, PostgreSQL has to decide at the point where
timeline 2 branches off which one it should follow.

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





view thread (10+ messages)  latest in thread

Message-ID: <ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.camel@cybertec.at>
Permalink:  ../ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.camel@cybertec.at/
Also on:    postgresql.org/message-id/ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.camel@cybertec.at

 · 

reply

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, wztdyl@sina.com
  Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
  In-Reply-To: <ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.camel@cybertec.at>
  References: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com> <0c552a0ee114314ceb026d65f75a98df3e8d22ff.camel@cybertec.at> <c73ac63988c2a162b9842ad7b5d394387c3703a1.camel@sina.com> <34d85bfc77e9a63890e28ea13953c30508233469.camel@cybertec.at> <41a74e2ac23015149bc98631b8dcac0fdb6b6a51.camel@sina.com> <ccbdaf1d321cb8e8f21ab93ad6915757d3b5dfe5.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