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_waldump: Add --save-fullpage=PATH to save full page images fr
Date: Mon, 26 Dec 2022 23:28:15 +0000
Message-ID: <E1p9wtD-000a5w-56@gemulon.postgresql.org> (raw)

pg_waldump: Add --save-fullpage=PATH to save full page images from WAL records

This option extracts (potentially decompressing) full-page images
included in WAL records into a given target directory.  These images are
subject to the same filtering rules as the normal display of the WAL
records, hence with --relation one can for example extract only the FPIs
issued on the relation defined.  By default, the records are printed or
their stats computed (--stats), using --quiet would only save the images
without any output generated.

This is a tool aimed mostly for very experienced users, useful for
fixing page-level corruption or just analyzing the past state of a page,
and there were no easy way to do that with the in-core tools up to now
when looking at WAL.

Each block is saved in a separate file, to ease their manipulation, with
the file respecting <lsn>.<ts>.<db>.<rel>.<blk>_<fork> with as format.

For instance, 00000000-010000C0.1663.1.6117.123_main refers to:
- WAL record LSN in hexa format (00000000-010000C0).
- Tablespace OID (1663).
- Database OID (1).
- Relfilenode (6117).
- Block number (123).
- Fork name of the file this block came from (_main).

Author: David Christensen
Reviewed-by: Sho Kato, Justin Pryzby, Bharath Rupireddy, Matthias van de
Meent
Discussion: https://postgr.es/m/CAOxo6XKjQb2bMSBRpePf3ZpzfNTwjQUc4Tafh21=jzjX6bX8CA@mail.gmail.com

Branch
------
master

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

Modified Files
--------------
doc/src/sgml/ref/pg_waldump.sgml          |  66 ++++++++++++++++++
src/bin/pg_waldump/meson.build            |   1 +
src/bin/pg_waldump/pg_waldump.c           | 108 +++++++++++++++++++++++++++++
src/bin/pg_waldump/t/002_save_fullpage.pl | 111 ++++++++++++++++++++++++++++++
4 files changed, 286 insertions(+)



Message-ID: <E1p9wtD-000a5w-56@gemulon.postgresql.org>
Permalink:  ../E1p9wtD-000a5w-56@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1p9wtD-000a5w-56@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_waldump: Add --save-fullpage=PATH to save full page images fr
  In-Reply-To: <E1p9wtD-000a5w-56@gemulon.postgresql.org>
  References: <E1p9wtD-000a5w-56@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