Re: redo failed in physical streaming replication while stopping the master server - Mailing list pgsql-hackers

From lannis
Subject Re: redo failed in physical streaming replication while stopping the master server
Date
Msg-id 1456999122522-5890391.post@n5.nabble.com
Whole thread Raw
In response to Re: Re: redo failed in physical streaming replication while stopping the master server  (Michael Paquier <michael.paquier@gmail.com>)
Responses Re: Re: redo failed in physical streaming replication while stopping the master server
List pgsql-hackers
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.



pgsql-hackers by date:

Previous
From: David Rowley
Date:
Subject: Re: WIP: Upper planner pathification
Next
From: Simon Riggs
Date:
Subject: Re: [NOVICE] WHERE clause not used when index is used