From: magodo <wztdyl@sina.com>
To: pgsql-general@postgresql.org
Subject: how to identify the timeline of specified recovery_target_time when do multiple PITR
Date: Tue, 02 Oct 2018 13:46:27 +0800
Message-ID: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com> (raw)
I read the document about recovery configuration, it says:
recovery_target_timeline (string)
...
Other than that you only need to set this parameter in complex re-
recovery situations, where you need to return to a state that itself
was reached after a point-in-time recovery. See Section 25.3.5 for
discussion.
...
Andin section 25.3.5 it says:
...
If you wish to recover into some child timeline (that is, you want
to return to some state that was itself generated after a recovery
attempt), you need to specify the target timeline ID in
recovery.conf.
...
Therefore, suppose I am going to recover to a point of some child
timeline, to identify the point, I have to specify either
recovery_target_name or recovery_target_time, and also specify the
recovery_target_timeline.
It is more like a tuple like (recovery_target_time,
recovery_target_timeline), that specify a real point among all history
branches. Am I understand this correctly?
If yes, what I want to ask is that, though the timeline is increasing
between different recovery, but each timestamp corresponds to a
timeline ID, one by one. So if I get a recovery_target_time, why should
I still specify the recovery_target_timeline?
Suppose following illustration:
A B
BASE-----+-----+------o1 (recover to A) 1
| | C
+.....|.......----+---o2 (regret, recover to B) 2
| |
+...........|..------o3 (regret again, recover to C) 3
|
+........---- 4
Legend:
BASE: basebackup
A-Z: recovery point
---: active wal histroy (continuous among branches)
...: inactive wal history
oN: point to do PITR
If am at "o3", and I want to recover to "C", if I don't specify
timeline ID, then i will ends up with state as "o1". Only if I specify
timeline ID as "2", then I can get the state as I expect (as
illustrated).
Why not just recover along the history from timeline 1 to the timeline
specified by recovery target? The only reason I can imagine is that
there is a chance that there are two active timeline at same point, but
what is the use case of that(if it exists)?
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: wztdyl@sina.com
Subject: Re: how to identify the timeline of specified recovery_target_time when do multiple PITR
In-Reply-To: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.com>
References: <29dd7b5cf905ee53026f96b78a505f1b76b6031b.camel@sina.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