Re: redo failed in physical streaming replication while stopping the master server

From: lannis <msp548546(at)163(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: redo failed in physical streaming replication while stopping the master server
Date: 2016-03-03 09:58:42
Message-ID: 1456999122522-5890391.post@n5.nabble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Simon Riggs 2016-03-03 10:07:34 Re: [NOVICE] WHERE clause not used when index is used
Previous Message David Rowley 2016-03-03 09:57:31 Re: WIP: Upper planner pathification