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

Поиск
Список
Период
Сортировка
От Michael Paquier
Тема Re: Re: redo failed in physical streaming replication while stopping the master server
Дата
Msg-id CAB7nPqQNh=jdzWO371FHC7MPZK9x5WoFfpuvi6tZ2YYQ0DJZUg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: redo failed in physical streaming replication while stopping the master server  (wcting <wcting163@163.com>)
Ответы Re: redo failed in physical streaming replication while stopping the master server  (lannis <msp548546@163.com>)
Список pgsql-hackers
On Wed, Mar 2, 2016 at 4:25 PM, wcting <wcting163@163.com> wrote:
> /*
>                  * If at page start, we must skip over the page header.  But
> we can't
>                  * do that until we've read in the page, since the header
> size is
>                  * variable.
>                  */
>
> i don't know the meaning behind this comments,
>
>  if ((RecPtr->xrecoff % XLogSegSize) == 0)
> it's a long page header, else a short page header,
>
> so "the header size" can be calculated ? right?

This means that the page must be read first, before recalculating the
record pointer to be the first one after the page header. This is done
a little bit after in ReadRecord():   pageHeaderSize = XLogPageHeaderSize((XLogPageHeader) readBuf);   targetRecOff =
RecPtr->xrecoff% XLOG_BLCKSZ;   if (targetRecOff == 0)   {       /*        * At page start, so skip over page header.
TheAssert checks that        * we're not scribbling on caller's record pointer; it's OK because we        * can only
gethere in the continuing-from-prev-record case, since        * XRecOffIsValid rejected the zero-page-offset case
otherwise.       */       Assert(RecPtr == &tmpRecPtr);       RecPtr->xrecoff += pageHeaderSize;       targetRecOff =
pageHeaderSize;  }
 
And XLogPageHeaderSize() makes the difference between a long a short header.
-- 
Michael



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

Предыдущее
От: Craig Ringer
Дата:
Сообщение: Re: TAP / recovery-test fs-level backups, psql enhancements etc
Следующее
От: Andres Freund
Дата:
Сообщение: Re: Confusing with commit time usage in logical decoding