Re: Multiple pg_waldump --rmgr options

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Multiple pg_waldump --rmgr options
Date: 2021-05-18 15:23:02
Message-ID: 20210518152302.4dt2epsn5adm5wjj@nol
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2021-05-18 15:34:55 Re: PG 14 release notes, first draft
Previous Message Bruce Momjian 2021-05-18 15:09:48 Re: PG 14 release notes, first draft