Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby
Дата
Msg-id CAB7nPqT9v45=+Nixv=pcnOOWUQ2tE8TX77-TcKEZ56tvyt4s2A@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby  (Marco Nenciarini <marco.nenciarini@2ndquadrant.it>)
Ответы Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby  (Marco Nenciarini <marco.nenciarini@2ndquadrant.it>)
Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby  (Noah Misch <noah@leadboat.com>)
Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby  (Amit Kapila <amit.kapila16@gmail.com>)
Re: [BUGS] BUG #14230: Wrong timeline returned by pg_stop_backup on a standby  (Magnus Hagander <magnus@hagander.net>)
Список pgsql-hackers
On Thu, Jul 7, 2016 at 12:57 AM, Marco Nenciarini
<marco.nenciarini@2ndquadrant.it> wrote:
> After further analysis, the issue is that we retrieve the starttli from
> the ControlFile structure, but it was using ThisTimeLineID when writing
> the backup label.
>
> I've attached a very simple patch that fixes it.

ThisTimeLineID is always set at 0 on purpose on a standby, so we
cannot rely on it (well it is set temporarily when recycling old
segments). At recovery when parsing the backup_label file there is no
actual use of the start segment name, so that's only a cosmetic
change. But surely it would be better to get that fixed, because
that's useful for debugging.

While looking at your patch, I thought that it would have been
tempting to use GetXLogReplayRecPtr() to get the timeline ID when in
recovery, but what we really want to know here is the timeline of the
last REDO pointer, which is starttli, and that's more consistent with
the fact that we use startpoint when writing the backup_label file. In
short, +1 for this fix.

I am adding that in the list of open items, adding Magnus in CC whose
commit for non-exclusive backups is at the origin of this defect.
-- 
Michael



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

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Documentation fixes for pg_visibility
Следующее
От: Amit Langote
Дата:
Сообщение: Re: pg_xlogfile_name_offset() et al and recovery