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

Re: [PATCH 3/5] Split out xlog reading into its own module called xlogreader

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCH 3/5] Split out xlog reading into its own module called xlogreader
Date: 2013-01-16 19:20:52
Message-ID: 20130116192052.GF4667@alvh.no-ip.org (view raw or flat)
Thread:
Lists: pgsql-hackers
Andres Freund wrote:

> The way xlog reading was done up to now made it impossible to use that
> nontrivial code outside of xlog.c although it is useful for different purposes
> like debugging wal (xlogdump) and decoding wal back into logical changes.

I have pushed this part after some more editorialization.

Most notably, (I think,) I removed the #ifdef FRONTEND piece.  I think
this should be part of the pg_xlogdump patch.  Sorry about this.

Also I changed XLogReaderAllocate() to not receive an initial read
starting point, because that seemed rather pointless.  Both xlog.c and
the submitted pg_xlogdump use a non-invalid RecPtr in their first call
AFAICS.

There was a bug in xlog.c's usage of XLogReadRecord: it was calling
ereport() on the errorbuf when the return value was NULL, which is not
always sane because some errors do not set the errorbuf.  I fixed that,
and I documented it more clearly in xlogreader.h (I hope).

I made some other minor stylistic changes, reworded a few comments, etc.

-- 
Álvaro Herrera                http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services


In response to

pgsql-hackers by date

Next:From: Tom LaneDate: 2013-01-16 19:28:05
Subject: Re: CF3+4
Previous:From: Josh BerkusDate: 2013-01-16 19:12:07
Subject: Re: Materialized views WIP patch

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