RE: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
shinya11.kato@nttdata.com
From: <Shinya11.Kato@nttdata.com>
To: <movead.li@highgo.ca>
Cc: <pgsql-hackers@postgresql.org>, <andres@anarazel.de>,
<michael@paquier.xyz>, <ahsan.hadi@highgo.ca>,
<horikyota.ntt@gmail.com>
Date: 2020-12-10T01:34:08Z
Lists: pgsql-hackers
Thanks for the reply. > Mr.Horiguchi.
I reviewed the patch and found some problems.
>+ if(startSegNo != endSegNo)
>+ else if(record->ReadRecPtr / XLOG_BLCKSZ !=
>+ if(rmid == RM_XLOG_ID && info == XLOG_SWITCH)
>+ if(ri == RM_XLOG_ID)
>+ if(info == XLOG_SWITCH)
You need to put a space after the "if".
>@@ -24,6 +24,7 @@
>#include "common/logging.h"
>#include "getopt_long.h"
>#include "rmgrdesc.h"
>+#include "catalog/pg_control.h"
I think the include statements should be arranged in alphabetical order.
>+ info = (rj << 4) & ~XLR_INFO_MASK;
>+ if(info == XLOG_SWITCH)
>+ XLogDumpStatsRow(psprintf("XLOG/SWITCH_JUNK"),
>+ 0, total_count, stats->junk_size, total_rec_len,
>+ 0, total_fpi_len, stats->junk_size, total_len);
Can't be described in the same way as "XLogDumpStatsRow(psprintf("%s/%s", desc->rm_name, id)..."?
Only this part looks strange.
Why are the "count" and "fpi_len" fields 0?
I think you need to improve the duplicate output in column "XLOG/SWITCH_JUNK".
Regards,
Shinya Kato
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