Improve the description of XLOG_RUNNING_XACTS.
authorAmit Kapila <[email protected]>
Wed, 2 Nov 2022 04:36:55 +0000 (10:06 +0530)
committerAmit Kapila <[email protected]>
Wed, 2 Nov 2022 04:36:55 +0000 (10:06 +0530)
Previously, the description of XLOG_RUNNING_XACTS showed only
top-transaction XIDs and whether subtransactions overflowed. This commit
improves it to show individual subtransaction XIDs. This also improves the
description of overflowed subtransactions.

This additional information can be helpful for testing and debugging
purposes.

Author: Masahiko Sawada
Reviewd by: Fujii Masao, Kyotaro Horiguchi, Ashutosh Bapat, Bharath Rupireddy
Discussion: https://postgr.es/m/CAD21AoAqvaE+XEeXHHPdAGQPcCoGXxuoeutq_nWhUSQvTt5+tA@mail.gmail.com

src/backend/access/rmgrdesc/standbydesc.c

index 2dba39e349ce348717dc5e2b1f65952d3dcda82e..4789df886a5aa25a87a23adb86b1a84d77bf5bfd 100644 (file)
@@ -33,7 +33,14 @@ standby_desc_running_xacts(StringInfo buf, xl_running_xacts *xlrec)
    }
 
    if (xlrec->subxid_overflow)
-       appendStringInfoString(buf, "; subxid ovf");
+       appendStringInfoString(buf, "; subxid overflowed");
+
+   if (xlrec->subxcnt > 0)
+   {
+       appendStringInfo(buf, "; %d subxacts:", xlrec->subxcnt);
+       for (i = 0; i < xlrec->subxcnt; i++)
+           appendStringInfo(buf, " %u", xlrec->xids[xlrec->xcnt + i]);
+   }
 }
 
 void