Couple of issues with pg_xlogdump - Mailing list pgsql-hackers

From Pavan Deolasee
Subject Couple of issues with pg_xlogdump
Date
Msg-id CABOikdN3mKj7607JOExOknmNXE8h80mwf=8XdwFRdrKmD8BH2w@mail.gmail.com
Whole thread Raw
Responses Re: Couple of issues with pg_xlogdump
List pgsql-hackers

Hello,

I was playing with pg_xlogdump in the HEAD and found a few issues.

1. Tried compiling pg_xlogdump via PGXS mechanism and it fails with the following error:
make: *** No rule to make target `/home/pavan.deolasee/work/pgsql/postgresql/install/lib/pgxs/src/makefiles/../../src/backend/access/transam/xlogreader.c', needed by `xlogreader.c'.  Stop.

There are no issues if the sources are compiled directly inside the contrib module

2. I created a fresh database cluster, created a table and COPY IN a million records in the table and then stopped the server. I then tried to dump the xlog files from pg_xlog directory.

[pavan.deolasee@puppetserver pg_xlogdump]$ ls ~/db93head/pg_xlog/
000000010000000000000004  000000010000000000000005  000000010000000000000006  000000010000000000000007  000000010000000000000008  archive_status

[pavan.deolasee@puppetserver pg_xlogdump]$ ./pg_xlogdump  ~/db93head/pg_xlog/000000010000000000000005
pg_xlogdump: FATAL:  could not find a valid record after 0/5000000
[pavan.deolasee@puppetserver pg_xlogdump]$ ./pg_xlogdump  ~/db93head/pg_xlog/000000010000000000000006
pg_xlogdump: FATAL:  could not find a valid record after 0/6000000
[pavan.deolasee@puppetserver pg_xlogdump]$ ./pg_xlogdump  ~/db93head/pg_xlog/000000010000000000000007
pg_xlogdump: FATAL:  could not find a valid record after 0/7000000
[pavan.deolasee@puppetserver pg_xlogdump]$ ./pg_xlogdump  ~/db93head/pg_xlog/000000010000000000000008
pg_xlogdump: FATAL:  could not find a valid record after 0/8000000

So pg_xlogdump gives error for all WAL files except the first one. Should it not have printed the WAL records from these files ?

The first file prints ok with this at the end:

[pavan.deolasee@puppetserver pg_xlogdump]$ ./pg_xlogdump  ~/db93head/pg_xlog/000000010000000000000004 | tail -n 2
pg_xlogdump: FATAL:  error in WAL record at 0/4C7F208: record with zero length at 0/4C7F270

rmgr: XLOG        len (rec/tot):     72/   104, tx:          0, lsn: 0/04C7F1A0, prev 0/04C7F170, bkp: 0000, desc: checkpoint: redo 0/4400D70; tli 1; prev tli 1; fpw true; xid 0/1807; oid 24576; multi 1; offset 0; oldest xid 1795 in DB 1; oldest multi 1 in DB 1; oldest running xid 0; online
rmgr: XLOG        len (rec/tot):     72/   104, tx:          0, lsn: 0/04C7F208, prev 0/04C7F1A0, bkp: 0000, desc: checkpoint: redo 0/4C7F208; tli 1; prev tli 1; fpw true; xid 0/1807; oid 16387; multi 1; offset 0; oldest xid 1795 in DB 1; oldest multi 1 in DB 1; oldest running xid 0; shutdown

But even this is a bit surprising because I would have expected the shutdown checkpoint WAL record in the last WAL file. Just to note, I stopped the server only once at the end of loading the data.

I hope I am not doing something terribly wrong here.

3. The usage of pg_xlogdump shows this:
Usage:
  pg_xlogdump [OPTION] [STARTSEG [ENDSEG]]

Looking at the usage, one might feel that the STARTSEG and ENDSEG both are optional. But if I try to invoke pg_xlogdump without any argument, it fails.

Thanks,
Pavan

pgsql-hackers by date:

Previous
From: Dean Rasheed
Date:
Subject: Re: 9.3 Beta1 status report
Next
From: Andres Freund
Date:
Subject: Re: Couple of issues with pg_xlogdump