Re: pgsql: Change how first WAL segment on new timeline after promotion is

Поиск
Список
Период
Сортировка
От Andres Freund
Тема Re: pgsql: Change how first WAL segment on new timeline after promotion is
Дата
Msg-id 20150103185957.GB15316@alap3.anarazel.de
обсуждение исходный текст
Ответ на pgsql: Change how first WAL segment on new timeline after promotion is  (Heikki Linnakangas <heikki.linnakangas@iki.fi>)
Список pgsql-committers
Hi Heikki,

While writing a test script for
http://archives.postgresql.org/message-id/20141205002854.GE21964%40awork2.anarazel.de
I noticed that this commit broke starting a pg_basebackup -X * without a
recovery.conf present. Which might not be the best idea, but imo is a
perfectly valid thing to do.

To me the changes to StartupXLOG() in that commit look a bit bogus. The
new startLogSegNo is initialized to XLByteToSeg(EndOfLog)? Which points
to the end of the record +1? Which thus isn't guaranteed to exist as a
segment (e.g. never if the last record was a XLOG_SWITCH).  Did you
perhaps intend to use XLogFileInit(use_existing = true) instead of
XLogFileOpen()? That works for me.

I've attached my preliminary testscript (note it's really not that
interesting at this point) that reliably reproduces the problem for me.

Greetings,

Andres Freund

--
 Andres Freund                       http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

Вложения

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

Предыдущее
От: Tom Lane
Дата:
Сообщение: pgsql: Treat negative values of recovery_min_apply_delay as having no e
Следующее
От: Andres Freund
Дата:
Сообщение: pgsql: Add pg_string_endswith as the start of a string helper library i