Thread: xlogreader v3/xlogdump v2

xlogreader v3/xlogdump v2

From
Andres Freund
Date:
Hi everyone,

At
http://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git;a=shortlog;h=refs/heads/xlogreader_v3
git://git.postgresql.org/git/users/andresfreund/postgres.git
you can find my attempt trying to bring the xlogreader from Heikki, as
modified by Alvaro, into a state where it has the capabilities to be
usable for BDR.

This is *preliminary* work, to see whether people roughly agree with the
API, there is some smoothing of edges left.

Changes I made:
* Add XLogFindNextRecord, to find the next valid xlog record >= an recptr
* Move the page validation handling into xlogreader
* Add support for reading pages which are only partially valid
* Add callback as a replacement for emode_for_corrupt_record

I don't like the last part, it seems ugly to me, but moving the full
error processing/formatting to a callback seems to involve more work. I
am willing to do that work, but would like some input first.

The xlogdump utility itself is in a mostly good state, some parts of
support infrastructure (ereport wrapper, realpathbackend,
timestamptz_to_str, pfree) need some work.

Any opinions?

I chose not to send the patch but rely on the git repository above, its
already somewhat large. If people prefer to see it fully on the list I
am happy to oblige.

Greetings,

Andres Freund

--Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services



Re: xlogreader v3/xlogdump v2

From
Andres Freund
Date:
Hi,

On 2012-12-04 18:52:13 +0100, Andres Freund wrote:
> At
> http://git.postgresql.org/gitweb/?p=users/andresfreund/postgres.git;a=shortlog;h=refs/heads/xlogreader_v3
> git://git.postgresql.org/git/users/andresfreund/postgres.git
> you can find my attempt trying to bring the xlogreader from Heikki, as
> modified by Alvaro, into a state where it has the capabilities to be
> usable for BDR.
>
> This is *preliminary* work, to see whether people roughly agree with the
> API, there is some smoothing of edges left.
>
> Changes I made:
> * Add XLogFindNextRecord, to find the next valid xlog record >= an recptr
> * Move the page validation handling into xlogreader
> * Add support for reading pages which are only partially valid
> * Add callback as a replacement for emode_for_corrupt_record
>
> I don't like the last part, it seems ugly to me, but moving the full
> error processing/formatting to a callback seems to involve more work. I
> am willing to do that work, but would like some input first.
>
> The xlogdump utility itself is in a mostly good state, some parts of
> support infrastructure (ereport wrapper, realpathbackend,
> timestamptz_to_str, pfree) need some work.

I pushed a new version of the patch with some fixes, more comments and a
slightly changed read_page callback API.

Greetings,

Andres Freund

--Andres Freund                       http://www.2ndQuadrant.com/PostgreSQL Development, 24x7 Support, Training &
Services