Fix pg_xlogdump so that it handles cross-page XLP_FIRST_IS_CONTRECORD record.
authorFujii Masao <fujii@postgresql.org>
Mon, 29 Aug 2016 05:34:58 +0000 (14:34 +0900)
committerFujii Masao <fujii@postgresql.org>
Mon, 29 Aug 2016 05:35:51 +0000 (14:35 +0900)
commit7dfb9b4796e05743398fc578ac7b25eab086721a
treea63528e5c7b4a5ed2132251c10c4eb46398b4adc
parentb09caece0df11266dd685187f4c86f452b378996
Fix pg_xlogdump so that it handles cross-page XLP_FIRST_IS_CONTRECORD record.

Previously pg_xlogdump failed to dump the contents of the WAL file
if the file starts with the continuation WAL record which spans
more than one pages. Since pg_xlogdump assumed that the continuation
record always fits on a page, it could not find the valid WAL record to
start reading from in that case.

This patch changes pg_xlogdump so that it can handle a continuation
WAL record which crosses a page boundary and find the valid record
to start reading from.

Back-patch to 9.3 where pg_xlogdump was introduced.

Author: Pavan Deolasee
Reviewed-By: Michael Paquier and Craig Ringer
Discussion: CABOikdPsPByMiG6J01DKq6om2+BNkxHTPkOyqHM2a4oYwGKsqQ@mail.gmail.com
src/backend/access/transam/xlogreader.c