Re: Streaming replication and pg_xlogfile_name()

Поиск
Список
Период
Сортировка
От Fujii Masao
Тема Re: Streaming replication and pg_xlogfile_name()
Дата
Msg-id 3f0b79eb1003020552q3135bb0ey616dae796f00ab87@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Streaming replication and pg_xlogfile_name()  (Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>)
Ответы Re: Streaming replication and pg_xlogfile_name()  (Fujii Masao <masao.fujii@gmail.com>)
Список pgsql-hackers
On Tue, Mar 2, 2010 at 8:54 PM, Heikki Linnakangas
<heikki.linnakangas@enterprisedb.com> wrote:
> This still suffers from ambiguity around a shutdown checkpoint that
> changes the TLI. On the page the shutdown checkpoint is on, what is the
> TLI in the page header? The TLI before the checkpoint record, I presume.
> Now consider a record on the same page after the checkpoint record. It's
> on the new timeline, but pg_last_xlog_replay_location() will return the
> old TLI, because that's on the page header.

Oh, I see. You are right.

> It's not clear what it should return, a TLI corresponding the filename
> of the WAL segment the record was replayed from, so that you can use
> pg_xlogfile_name() to find out the filename of the WAL segment being
> replayed, or the accurate TLI of the record being replayed. I'm leaning
> towards the latter, it feels more correct and accurate, but you could
> argue for the former too. In any case, it needs to be well-defined.

I agree with you that the latter is more correct and accurate. The simple
fix is updating the lastPageTLI with the CheckPoint->ThisTimeLineID when
replaying the shutdown checkpoint record. Though we might need to use new
variable to keep the last applied timeline instead of the lastPageTLI.

Regards,

-- 
Fujii Masao
NIPPON TELEGRAPH AND TELEPHONE CORPORATION
NTT Open Source Software Center


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

Предыдущее
От: Greg Smith
Дата:
Сообщение: Re: building postgres-A4.tex-pdf crushed
Следующее
От: Theo Schlossnagle
Дата:
Сообщение: Re: double and numeric conversion