Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
Kyotaro Horiguchi <horikyota.ntt@gmail.com>
From: Kyotaro Horiguchi <horikyota.ntt@gmail.com>
To: movead.li@highgo.ca
Cc: michael@paquier.xyz, pgsql-hackers@postgresql.org, ahsan.hadi@highgo.ca
Date: 2020-10-14T01:29:44Z
Lists: pgsql-hackers
At Mon, 12 Oct 2020 09:46:37 +0800, "movead.li@highgo.ca" <movead.li@highgo.ca> wrote in > > Thanks for reply. > > >If you wish to add more information about a XLOG_SWITCH record, I > >don't think that changing the signature of XLogDumpRecordLen() is > >adapted because the record length of this record is defined as > >Horiguchi-san mentioned upthread, and the meaning of junk_len is > >confusing here. It seems to me that any extra information should be > >added to xlog_desc() where there should be an extra code path for > >(info == XLOG_SWITCH). XLogReaderState should have all the > >information you are lookng for. > We have two places to use the 'junk_len', one is when we show the > detail record information, another is when we statistics the percent > of all kind of wal record kinds(by --stat=record). The second place > will not run the xlog_desc(), so it's not a good chance to do the thing. > > I am still can not understand why it can't adapted to change the > signature of XLogDumpRecordLen(), maybe we can add a new function > to caculate the 'junk_len' and rename the 'junk_len' as 'skiped_size' or > 'switched_size'? The reason is the function XLogDumpRecordLen is a common function among all kind of LOG records, not belongs only to XLOG_SWICH. And the junk_len is not useful for other than XLOG_SWITCH. Descriptions specifc to XLOG_SWITCH is provided by xlog_desc(). regards. -- Kyotaro Horiguchi NTT Open Source Software Center
Commits
-
pg_waldump: Fix bug in per-record statistics.
- e73068b0710b 9.6.22 landed
- 5386a8506d7d 10.17 landed
- 4a2627c41cfe 11.12 landed
- 4220e06f4c0c 12.7 landed
- 34279fd4fabd 13.3 landed
- 51893c846350 14.0 landed