Thanks for your reply. If we only take replay for consideration, yeah, we do this header check until we've read the page first.
But thanks to the master xlog generator, we know that: when we try advance XLOG insert buffer (page), we treate the new page header as short header at first. then we use this condition to make it a long header. if ((NewPage->xlp_pageaddr.xrecoff % XLogSegSize) == 0) { XLogLongPageHeader NewLongPage = (XLogLongPageHeader) NewPage; NewLongPage->xlp_sysid = ControlFile->system_identifier; NewLongPage->xlp_seg_size = XLogSegSize; NewLongPage->xlp_xlog_blcksz = XLOG_BLCKSZ; NewPage ->xlp_info |= XLP_LONG_HEADER; Insert->currpos = ((char *) NewPage) +SizeOfXLogLongPHD; } So in the replay scenario, before we read the page from wal segment file, using the specical RecPtr which point to the next page header address, can we predicat the page header is a long or short? regards, fanbin -- View this message in context: http://postgresql.nabble.com/redo-failed-in-physical-streaming-replication-while-stopping-the-master-server-tp5889961p5890391.html Sent from the PostgreSQL - hackers mailing list archive at Nabble.com. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers