pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Fujii Masao <masao.fujii@oss.nttdata.com>
To: Shinya11.Kato@nttdata.com
To: david@pgmasters.net
To: movead.li@highgo.ca
Cc: pgsql-hackers@postgresql.org
Cc: andres@anarazel.de
Cc: michael@paquier.xyz
Cc: ahsan.hadi@highgo.ca
Cc: horikyota.ntt@gmail.com
Subject: Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
Date: Mon, 22 Mar 2021 14:07:43 +0900
Message-ID: <f3d945f2-fce5-5f43-6811-50ba2c8d69c4@oss.nttdata.com> (raw )
In-Reply-To: <OSBPR01MB28859FA68FC172FAEAA1C9DFC4659@OSBPR01MB2885.jpnprd01.prod.outlook.com >
References: <20201016.180033.217520066292592870.horikyota.ntt@gmail.com >
<2020101617395691465546@highgo.ca >
<240cd11dc6664dfcbef50c2d6b16ccb2@MP-MSGSS-MBX001.msg.nttdata.co.jp >
<20201204.152047.1606427486743708152.horikyota.ntt@gmail.com >
<b0a32c58414546b78b03f2c281f2f145@MP-MSGSS-MBX001.msg.nttdata.co.jp >
<2021010611143203905334@highgo.ca >
<066b8dd96b164ec2ac3af6cf6e33a0d5@MP-MSGSS-MBX001.msg.nttdata.co.jp >
<fa69fe77-a64b-0207-fbd0-3d16b4940c95@pgmasters.net >
<TYAPR01MB28966A71B35D1E22FE9450AFC4689@TYAPR01MB2896.jpnprd01.prod.outlook.com >
<785ae632-3c4f-f291-d2b7-c2a08fab103b@oss.nttdata.com >
<790571f2-7068-3717-6223-85683db74542@oss.nttdata.com >
<OSBPR01MB28859FA68FC172FAEAA1C9DFC4659@OSBPR01MB2885.jpnprd01.prod.outlook.com >
On 2021/03/22 14:03, Shinya11.Kato@nttdata.com wrote:
>> Barring any objection, I will commit this.
>
> I think it's good except for a typo "thoes four bits"
Thanks for the review! Attached is the updated version of the patch.
Regards,
--
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION
Attachments:
fix_pg_waldump_xact_commit_record_stats_fujii_v2.patch (text/plain, 799B) download
diff --git a/src/bin/pg_waldump/pg_waldump.c b/src/bin/pg_waldump/pg_waldump.c
index 610f65e471..f8b8afe4a7 100644
--- a/src/bin/pg_waldump/pg_waldump.c
+++ b/src/bin/pg_waldump/pg_waldump.c
@@ -438,6 +438,15 @@ XLogDumpCountRecord(XLogDumpConfig *config, XLogDumpStats *stats,
recid = XLogRecGetInfo(record) >> 4;
+ /*
+ * XACT records need to be handled differently. Those records use the
+ * first bit of those four bits for an optional flag variable and the
+ * following three bits for the opcode. We filter opcode out of xl_info
+ * and use it as the identifier of the record.
+ */
+ if (rmid == RM_XACT_ID)
+ recid &= 0x07;
+
stats->record_stats[rmid][recid].count++;
stats->record_stats[rmid][recid].rec_len += rec_len;
stats->record_stats[rmid][recid].fpi_len += fpi_len;
view thread (28+ messages) latest in thread
Message-ID: <f3d945f2-fce5-5f43-6811-50ba2c8d69c4@oss.nttdata.com>
Permalink: ../f3d945f2-fce5-5f43-6811-50ba2c8d69c4@oss.nttdata.com/
Also on: postgresql.org/message-id/f3d945f2-fce5-5f43-6811-50ba2c8d69c4@oss.nttdata.com
copy link · copy postgr.es · copy git am
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: masao.fujii@oss.nttdata.com, Shinya11.Kato@nttdata.com, david@pgmasters.net, movead.li@highgo.ca, andres@anarazel.de, michael@paquier.xyz, ahsan.hadi@highgo.ca, horikyota.ntt@gmail.com
Subject: Re: Wrong statistics for size of XLOG_SWITCH during pg_waldump.
In-Reply-To: <f3d945f2-fce5-5f43-6811-50ba2c8d69c4@oss.nttdata.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox