Re: Patch-2 (2-move-continuation-record-to-page-header.patch) WAL Format Changes

From: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>
To: Amit Kapila <amit(dot)kapila(at)huawei(dot)com>
Cc: 'Pg Hackers' <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Patch-2 (2-move-continuation-record-to-page-header.patch) WAL Format Changes
Date: 2012-06-28 17:39:18
Message-ID: 4FEC96C6.7050408@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 28.06.2012 17:40, Amit Kapila wrote:
> 1.
> @@ -693,7 +693,6 @@ XLogInsert(RmgrId rmid, uint8 info, XLogRecData *rdata)
> {
> XLogCtlInsert *Insert =&XLogCtl->Insert;
> XLogRecord *record;
> - XLogContRecord *contrecord;
> XLogRecPtr RecPtr;
> XLogRecPtr WriteRqst;
> uint32 freespace;
> @@ -1082,9 +1081,7 @@ begin:;
> curridx = Insert->curridx;
> /* Insert cont-record header */
> Insert->currpage->xlp_info |= XLP_FIRST_IS_CONTRECORD;
> - contrecord = (XLogContRecord *) Insert->currpos;
> - contrecord->xl_rem_len = write_len;
> - Insert->currpos += SizeOfXLogContRecord;
> + Insert->currpage->xlp_rem_len = write_len;
>
> After above code changes the comment "/* Insert cont-record header */"
> should be changed.

Thanks, fixed.

> 2.
> Is XLP_FIRST_IS_CONTRECORD required after putting xl_rem_len in page header;
>
> Can't we do handling based on xl_rem_len?

Hmm, yeah, it's redundant now, we could use xl_rem_len > 0 to indicate a
continued record. I thought I'd keep the flag to avoid unnecessary
changes, to make life a bit easier for 3rd party tools that read the
WAL, but I don't know if it really makes any difference. There is no
shortage of xlog page header flag bits, so there's no hurry to get rid
of it.

> Sorry for sending the observations in pieces rather than all-together, as I
> am not sure how much I will be able to complete.
>
> So what ever I am able to read, I am sending you my doubts or observations.

Thanks for the review, much appreciated!

--
Heikki Linnakangas
EnterpriseDB http://www.enterprisedb.com

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-06-28 17:43:16 Re: Posix Shared Mem patch
Previous Message Magnus Hagander 2012-06-28 17:30:29 Re: Posix Shared Mem patch