Re: Add a new pg_walinspect function to extract FPIs from WAL records
Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
From: Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>
To: "Drouvot, Bertrand" <bertranddrouvot.pg@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2023-01-06T06:17:55Z
Lists: pgsql-hackers
Attachments
- v3-0001-Add-FPI-extract-function-to-pg_walinspect.patch (application/octet-stream) patch v3-0001
On Thu, Jan 5, 2023 at 6:51 PM Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com> wrote: > > > I'm also wondering if it would make sense to extend the test coverage of it (and pg_waldump) to "validate" that both > > extracted images are the same and matches the one modified right after the checkpoint. > > > > What do you think? (could be done later in another patch though). > > I think pageinspect can be used here. We can fetch the raw page from > the table after the checkpoint and raw FPI from the WAL record logged > as part of the update. I've tried to do so [1], but I see a slight > difference in the raw output. The expectation is that they both be the > same. It might be that the update operation logs the FPI with some > more info set (prune_xid). I'll try to see why it is so. > > I'm attaching the v2 patch for further review. > > [1] > SELECT * FROM page_header(:'page_from_table'); > lsn | checksum | flags | lower | upper | special | pagesize | > version | prune_xid > -----------+----------+-------+-------+-------+---------+----------+---------+----------- > 0/1891D78 | 0 | 0 | 40 | 8064 | 8192 | 8192 | > 4 | 0 > (1 row) > > SELECT * FROM page_header(:'page_from_wal'); > lsn | checksum | flags | lower | upper | special | pagesize | > version | prune_xid > -----------+----------+-------+-------+-------+---------+----------+---------+----------- > 0/1891D78 | 0 | 0 | 44 | 8032 | 8192 | 8192 | > 4 | 735 > (1 row) Ugh, v2 patch missed the new file added, I'm attaching v3 patch for further review. Sorry for the noise. -- Bharath Rupireddy PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com
Commits
-
pg_walinspect: Add pg_get_wal_fpi_info()
- c31cf1c03d01 16.0 landed
-
pg_waldump: Add --save-fullpage=PATH to save full page images from WAL records
- d497093cbecc 16.0 cited