pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()
Date: Fri, 10 Mar 2023 01:10:07 +0000
Message-ID: <E1paRGp-002lsx-Du@gemulon.postgresql.org> (raw)

pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()

This commit reworks pg_get_wal_fpi_info() to become aware of all the
block information that can be attached to a record rather than just its
full-page writes:
- Addition of the block id as assigned by XLogRegisterBuffer(),
XLogRegisterBlock() or XLogRegisterBufData().
- Addition of the block data, as bytea, or NULL if none.  The length of
the block data can be guessed with length(), so there is no need to
store its length in a separate field.
- Addition of the full-page image length, as counted without a hole or
even compressed.
- Modification of the handling of the full-page image data.  This is
still a bytea, but it could become NULL if none is assigned to a block.
- Addition of the full-page image flags, tracking if a page is stored
with a hole, if it needs to be applied and the type of compression
applied to it, as of all the BKPIMAGE_* values in xlogrecord.h.

The information of each block is returned as one single record, with the
record's ReadRecPtr included to be able to join the block information
with the existing pg_get_wal_records_info().  Note that it is perfectly
possible for a block to hold both data and full-page image.

Thanks also to Kyotaro Horiguchi and Matthias van de Meent for the
discussion.

This commit uses some of the work proposed by Melanie, though it has
been largely redesigned and rewritten by me.  Bharath has helped in
refining a bit the whole.

Reported-by: Melanie Plageman
Author: Michael Paquier, Melanie Plageman, Bharath Rupireddy
Discussion: https://postgr.es/m/CAAKRu_bORebdZmcV8V4cZBzU8M_C6tDDdbiPhCZ6i-iuSXW9TA@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9ecb134a93f0a82540b0e0bed67b30d0c9eb836a

Modified Files
--------------
contrib/pg_walinspect/expected/pg_walinspect.out  |  35 ++++--
contrib/pg_walinspect/pg_walinspect--1.0--1.1.sql |  16 ++-
contrib/pg_walinspect/pg_walinspect.c             | 140 +++++++++++++++-------
contrib/pg_walinspect/sql/pg_walinspect.sql       |  33 ++---
doc/src/sgml/pgwalinspect.sgml                    |  36 +++---
5 files changed, 174 insertions(+), 86 deletions(-)



Message-ID: <E1paRGp-002lsx-Du@gemulon.postgresql.org>
Permalink:  ../E1paRGp-002lsx-Du@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1paRGp-002lsx-Du@gemulon.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz
  Subject: Re: pgsql: pg_walinspect: pg_get_wal_fpi_info() -> pg_get_wal_block_info()
  In-Reply-To: <E1paRGp-002lsx-Du@gemulon.postgresql.org>
  References: <E1paRGp-002lsx-Du@gemulon.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox