Re: Multiple pg_waldump --rmgr options - Mailing list pgsql-hackers

From Julien Rouhaud
Subject Re: Multiple pg_waldump --rmgr options
Date
Msg-id 20210518152302.4dt2epsn5adm5wjj@nol
Whole thread Raw
In response to Multiple pg_waldump --rmgr options  (Heikki Linnakangas <hlinnaka@iki.fi>)
Responses Re: Multiple pg_waldump --rmgr options
List pgsql-hackers
On Tue, May 18, 2021 at 04:50:31PM +0300, Heikki Linnakangas wrote:
> I wanted to dump all heap WAL records with pg_waldump, so I did this:
> 
> > $ pg_waldump --rmgr=heap --rmgr=heap2 data/pg_wal/000000010000000000000001 --stat=record
> > Type                                           N      (%)          Record size      (%)             FPI size
(%)       Combined size      (%)
 
> > ----                                           -      ---          -----------      ---             --------
---       -------------      ---
 
> > Heap2/PRUNE                                  268 (  8.74)                18192 (  2.73)                    0 (
0.00)               18192 (  1.74)
 
> > Heap2/VACUUM                                  55 (  1.79)                 4940 (  0.74)                    0 (
0.00)                4940 (  0.47)
 
> > Heap2/FREEZE_PAGE                            277 (  9.03)               186868 ( 28.03)                    0 (
0.00)              186868 ( 17.86)
 
> > Heap2/VISIBLE                                467 ( 15.23)                27783 (  4.17)               376832 (
99.34)              404615 ( 38.68)
 
> > Heap2/MULTI_INSERT                          1944 ( 63.38)               354800 ( 53.21)                 2520 (
0.66)              357320 ( 34.16)
 
> > Heap2/MULTI_INSERT+INIT                       56 (  1.83)                74152 ( 11.12)                    0 (
0.00)               74152 (  7.09)
 
> >                                         --------                      --------                      --------
             --------
 
> > Total                                       3067                        666735 [63.74%]               379352
[36.26%]             1046087 [100%]
 
> > pg_waldump: fatal: error in WAL record at 0/1680118: invalid record length at 0/1680150: wanted 24, got 0
> 
> That didn't do what I wanted. It only printed the Heap2 records, not Heap,
> even though I specified both. The reason is that if you specify multiple
> --rmgr options, only the last one takes effect.
> 
> I propose the attached to allow selecting multiple rmgrs, by giving multiple
> --rmgr options. With that, it works the way I expected:

The change and the patch look sensible to me.



pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: PG 14 release notes, first draft
Next
From: Peter Geoghegan
Date:
Subject: Re: PG 14 release notes, first draft