On 2021/03/22 14:03, shinya11.k...@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
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;

Reply via email to