Re: Improve description of XLOG_RUNNING_XACTS

From: Kyotaro Horiguchi <horikyota(dot)ntt(at)gmail(dot)com>
To: ashutosh(dot)bapat(at)enterprisedb(dot)com
Cc: sawada(dot)mshk(at)gmail(dot)com, ashutosh(dot)bapat(dot)oss(at)gmail(dot)com, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Improve description of XLOG_RUNNING_XACTS
Date: 2022-07-28 06:24:54
Message-ID: 20220728.152454.401226639721769547.horikyota.ntt@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At Thu, 28 Jul 2022 09:56:33 +0530, Ashutosh Bapat <ashutosh(dot)bapat(at)enterprisedb(dot)com> wrote in
> Thanks Masahiko for the updated patch. It looks good to me.
>
> I wonder whether the logic should be, similar
> to ProcArrayApplyRecoveryInfo()
> if (xlrec->subxid_overflow)
> ...
> else if (xlrec->subxcnt > 0)
> ...
>
> But you may ignore it.

Either is fine if we asuume the record is sound, but since it is
debugging output, I think we should always output the information *for
both* . The following change doesn't change the output for a sound
record.

====
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]);
}
- else if (xlrec->subxid_overflow)
+ if (xlrec->subxid_overflow)
appendStringInfoString(buf, "; subxid overflowed");
====

Another point is if the xid/subxid lists get long, I see it annoying
that the "overflowed" messages goes far away to the end of the long
line. Couldn't we rearrange the item order of the line as the follows?

nextXid %u latestCompletedXid %u oldestRunningXid %u;[ subxid overflowed;][ %d xacts: %u %u ...;][ subxacts: %u %u ..]

regards.

--
Kyotaro Horiguchi
NTT Open Source Software Center

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2022-07-28 06:25:33 Re: [BUG] Logical replication failure "ERROR: could not map filenode "base/13237/442428" to relation OID" with catalog modifying txns
Previous Message Harinath Kanchu 2022-07-28 06:20:24 How to get accurate backup end time when it is taken from synchronous standby ?