From: Amit Kapila Date: Wed, 2 Nov 2022 04:36:55 +0000 (+0530) Subject: Improve the description of XLOG_RUNNING_XACTS. X-Git-Tag: REL_16_BETA1~1393 X-Git-Url: http://git.postgresql.org/gitweb/?a=commitdiff_plain;h=568546f7e46a48c065c631338c0eba1de9264ff1;p=postgresql.git Improve the description of XLOG_RUNNING_XACTS. 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 --- diff --git a/src/backend/access/rmgrdesc/standbydesc.c b/src/backend/access/rmgrdesc/standbydesc.c index 2dba39e349c..4789df886a5 100644 --- a/src/backend/access/rmgrdesc/standbydesc.c +++ b/src/backend/access/rmgrdesc/standbydesc.c @@ -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