Re: WAL format and API changes (9.5)

From: Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: WAL format and API changes (9.5)
Date: 2014-08-13 17:05:58
Message-ID: 53EB9AF6.6050703@vmware.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/13/2014 04:15 PM, Heikki Linnakangas wrote:
> Hmm, thinking about this some more, there is one sensible way to split
> this patch: We can add the XLogReplayBuffer() function and rewrite all
> the redo routines to use it, without changing any WAL record formats or
> anything in the way the WAL records are constructed. In the patch,
> XLogReplayBuffer() takes one input arument, the block reference ID, and
> it fetches the RelFileNode and BlockNumber of the block based on that.
> Without the WAL format changes, the information isn't there in the
> record, but we can require the callers to pass the RelFileNode and
> BlockNumber. The final patch will remove those arguments from every
> caller, but that's a very mechanical change.
>
> As in the attached patch. I only modified the heapam redo routines to
> use the new XLogReplayBuffer() idiom; the idea is to do that for every
> redo routine.
>
> After applying such a patch, the main WAL format changing patch becomes
> much smaller, and makes it easier to see from the redo routines where
> significant changes to the WAL record formats have been made. This also
> allows us to split the bikeshedding; we can discuss the name of
> XLogReplayBuffer() first :-).

Here's a full version of this refactoring patch, all the rmgr's have now
been updated to use XLogReplayBuffer(). I think this is a worthwhile
change on its own, even if we drop the ball on the rest of the WAL
format patch, because it makes the redo-routines more readable. I
propose to commit this as soon as someone has reviewed it, and we agree
on a for what's currently called XLogReplayBuffer(). I have tested this
with my page-image comparison tool.

- Heikki

Attachment Content-Type Size
xlogreplaybuffer-2.patch text/x-diff 120.2 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tomas Vondra 2014-08-13 17:17:11 Re: failures on barnacle (CLOBBER_CACHE_RECURSIVELY) because of memory leaks
Previous Message Rajmohan C 2014-08-13 16:33:31 how to implement selectivity injection in postgresql