pgsql: Fix record length computation in pg_waldump/xlogdump.

From: Andres Freund <andres(at)anarazel(dot)de>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix record length computation in pg_waldump/xlogdump.
Date: 2017-06-05 23:12:00
Message-ID: E1dI1AG-00017A-0v@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Fix record length computation in pg_waldump/xlogdump.

The current method of computing the record length (excluding the
lenght of full-page images) has been wrong since the WAL format has
been revamped in 2c03216d831160bedd72d45f712601b6f7d03f1c. Only the
main record's length was counted, but that can be significantly too
little if there's data associated with further blocks.

Fix by computing the record length as total_lenght - fpi_length.

Reported-By: Chen Huajun
Bug: #14687
Reviewed-By: Heikki Linnakangas
Discussion: https://postgr.es/m/20170603165939.1436.58887@wrigleys.postgresql.org
Backpatch: 9.5-

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/c25ed20067d21a97242a023031fcdcc232d6945c

Modified Files
--------------
src/bin/pg_waldump/pg_waldump.c | 49 ++++++++++++++++++++++++++++-------------
1 file changed, 34 insertions(+), 15 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Andres Freund 2017-06-05 23:12:03 pgsql: Fix record length computation in pg_waldump/xlogdump.
Previous Message Tom Lane 2017-06-05 18:51:10 pgsql: Code review for shm_toc.h/.c.