Skip site navigation (1) Skip section navigation (2)

Re: log_newpage header comment

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: log_newpage header comment
Date: 2012-06-08 17:20:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
On Fri, Jun 8, 2012 at 9:56 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> OK.  So what I'm thinking is that we should add a new function that
> takes a relfilenode and a buffer and steps 4-6 of what's described in
> transam/README: mark the buffer dirty, xlog it, and set the LSN and
> TLI.  We might want to have this function assert that it is in a
> critical section, for the avoidance of error.  Then anyone who wants
> to use it can do steps 1-3, call the function, and then finish up with
> steps 6-7.  I don't think we can cleanly encapsulate any more than
> that.

On further review, I think that we ought to make MarkBufferDirty() the
caller's job, because sometimes we may need to xlog only if
XLogIsNeeded(), but the buffer's got to get marked dirty either way.
So I think the new function should just do step 5 - emit XLOG and set

Proposed patch attached.

Robert Haas
The Enterprise PostgreSQL Company

Attachment: log-newpage-buffer-v1.patch
Description: application/octet-stream (3.9 KB)

In response to


pgsql-hackers by date

Next:From: Robert HaasDate: 2012-06-08 17:26:20
Subject: Re: Temporary tables under hot standby
Previous:From: Robert HaasDate: 2012-06-08 17:15:07
Subject: Re: Checkpointer on hot standby runs without looking checkpoint_segments

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group