Re: how to identify the timeline of specified recovery_target_timewhen do multiple PITR

Поиск
Список
Период
Сортировка
От magodo
Тема Re: how to identify the timeline of specified recovery_target_timewhen do multiple PITR
Дата
Msg-id 32dd51b8c3848258511d97597a15292b2e97b7e0.camel@sina.com
обсуждение исходный текст
Ответ на Re: how to identify the timeline of specified recovery_target_timewhen do multiple PITR  (Laurenz Albe <laurenz.albe@cybertec.at>)
Список pgsql-general
On Thu, 2018-10-11 at 19:53 +0200, Laurenz Albe wrote:

Indeed, your sentence

if , for example, it recovered to "A" at "o1", then
the switched WAL(in case of stop-then-recover) or .partial
corresponding WAL(in case of promote) is the last WAL of the timeline1

seems to contradict your drawing, which has B after A on timeline 1.

Err... I mean "o1" is the end of timelien1, and the last WAL is the one "o1" was on just before recovering to "A".


Example:
Assume that timeline 1 reaches to 000000010000001500000030.
We recover to point A, which is in the middle of 000000010000001500000020,
and there branch to timeline 2.
After some time, we decide to recover again, starting from a
checkpoint in 000000010000001500000010.
We want to recover to 2018-10-11 12:00:00.

How can you know how many WAL segments there are on timeline 1, and if
there is one that extends past 2018-10-11 12:00:00 or not?

This is the exact problem I want to figure out. My approach is as you said, I will parse each archived WAL segment via `pg_xlogdump -r Transaction`, and try to find the first least earliest WAL against the specified time. This is a linear search, which has complexity of O(n).

So if you want to recover to that point of time, how do you choose the timeline?

---
Magodo

В списке pgsql-general по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: Code of Conduct plan
Следующее
От: Laurenz Albe
Дата:
Сообщение: Re: how to identify the timeline of specified recovery_target_timewhen do multiple PITR