Re: pg_xlogdump fails to handle WAL file with multi-page XLP_FIRST_IS_CONTRECORD data - Mailing list pgsql-hackers

From Craig Ringer
Subject Re: pg_xlogdump fails to handle WAL file with multi-page XLP_FIRST_IS_CONTRECORD data
Date
Msg-id CAMsr+YEziXkrBUJDN0q1aGQSLKZkqm7z-+8_jXyO0npUp_=ndQ@mail.gmail.com
Whole thread Raw
In response to Re: pg_xlogdump fails to handle WAL file with multi-page XLP_FIRST_IS_CONTRECORD data  (Pavan Deolasee <pavan.deolasee@gmail.com>)
Responses Re: pg_xlogdump fails to handle WAL file with multi-page XLP_FIRST_IS_CONTRECORD data
List pgsql-hackers
On 23 March 2016 at 18:04, Pavan Deolasee <pavan.deolasee@gmail.com> wrote:


On Wed, Mar 23, 2016 at 1:13 PM, Michael Paquier <michael.paquier@gmail.com> wrote:

+       /*
+        * Compute targetRecOff. It should typically be greater than short
+        * page-header since a valid record can't , but can also be zero when
+        * caller has supplied a page-aligned address or when we are skipping
+        * multi-page continuation record. It doesn't matter though because
+        * ReadPageInternal() will read at least short page-header worth of
+        * data
+        */
This needs some polishing, there is an unfinished sentence here.

+       targetRecOff = tmpRecPtr % XLOG_BLCKSZ;
targetRecOff, pageHeaderSize and targetPagePtr could be declared
inside directly the new while loop.

Thanks Michael for reviewing the patch. I've fixed these issues and new version is attached.


Can you describe the process used to generate the sample WAL segment?

I'd like to turn it into a TAP test to go along with the patch. 



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

pgsql-hackers by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Very small patch for decode.c
Next
From: Craig Ringer
Date:
Subject: Re: So, can we stop supporting Windows native now?