WAL_DEBUG logs spurious data - Mailing list pgsql-hackers

From Markus Wanner
Subject WAL_DEBUG logs spurious data
Date
Msg-id 5077355E.50501@bluegap.ch
Whole thread Raw
Responses Re: WAL_DEBUG logs spurious data  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Hi,

I stumbled across a minor issue in xlog.c:1030: the WAL_DEBUG code block
there passes rdata->data to the rm_desc() methode. However, that's only
the first XLogRecData struct, not the entire XLog record. So the
rm_desc() method effectively reports spurious data for any subsequent part.

Take a commit record with subxacts as an example: during XLogInsert,
Postgres reports the following:

LOG:  INSERT @ 0/16F3270: prev 0/16F3234; xid 688; len 16: Transaction -
commit: 2012-10-11 09:31:17.790368-07; subxacts: 3214563816

Note that the xid in subxacts is way off. During recovery from WAL, the
record is logged correctly:

LOG:  REDO @ 0/16F3270; LSN 0/16F329C: prev 0/16F3234; xid 688; len 16:
Transaction - commit: 2012-10-11 09:31:17.790368-07; subxacts: 689

Attached is a possible fix.

Regards

Markus Wanner

Attachment

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Deprecating RULES
Next
From: Dimitri Fontaine
Date:
Subject: Re: Deprecating RULES