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