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

[PATCH] XLogReader v2

From: Andres Freund <andres(at)2ndquadrant(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Heikki Linnakangas <heikki(dot)linnakangas(at)enterprisedb(dot)com>, satoshi(dot)nagayasu(at)gmail(dot)com
Subject: [PATCH] XLogReader v2
Date: 2012-07-19 10:29:03
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

Attached is v2 of the patch.

Changes are:
* more comments
* significantly cleaned/simpliefied coded
* crc validation
* addition of XLogReaderReadOne

Definitely needed are:
* better validation of records
* customizable error handling

The first is just work that needs to be done, nothing complicated. 
The second is a bit more complicated:
- We could have an bool had_error and a static char that contains the error 
message, the caller can handle that as wanted
- We could have a callback for error handling

I think I prefer the callback solution.

The second attached patch is a very, very preliminary xlog dumping utility 
which currently is more of a debugging facility (as evidenced by the fact that 
it needs and existing /tmp/xlog directory for writing out data) for the 
XLogReader. It reuses the builtin xlog dumping logic and thus has to link with 
backend code. I couldn't find a really sensible way to do this:

xlogdump: $(OBJS) $(shell find ../../backend ../../timezone -name 
objfiles.txt|xargs cat|tr -s " " "\012"|grep -v /main.o|sed 's/^/..\/..\/..
        $(CC) $(CFLAGS) $^ $(LDFLAGS) $(LDFLAGS_EX) $(LIBS) -o $(at)$(X)

Perhaps somebody has a better idea? I think having an xlogdump utility in 
core/contrib would be a good idea now that it can be done without a huge 
amount of code duplication. I plan to check Satoshi-san's version of xlogdump 
whether I can crib some of the commandline interface and some code from there.



 Andres Freund	         
 PostgreSQL Development, 24x7 Support, Training & Services

Attachment: 0001-Add-support-for-a-generic-wal-reading-facility-dubbe.patch
Description: text/x-patch (39.9 KB)
Attachment: 0002-add-simple-xlogdump-tool.patch
Description: text/x-patch (10.3 KB)


pgsql-hackers by date

Next:From: Alexander LawDate: 2012-07-19 11:50:44
Subject: Re: [GENERAL] main log encoding problem
Previous:From: Alexander LawDate: 2012-07-19 09:33:01
Subject: Re: main log encoding problem

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