Sorry for the late reply.

On Thu, Jul 28, 2022 at 4:29 PM Kyotaro Horiguchi
<horikyota....@gmail.com> wrote:
>
> At Thu, 28 Jul 2022 15:53:33 +0900, Masahiko Sawada <sawada.m...@gmail.com> 
> wrote in
> > >
> > Do you mean that both could be true at the same time? If I read
> > GetRunningTransactionData() correctly, that doesn't happen.
>
> So, I wrote "since it is debugging output", and "fine if we asuume the
> record is sound". Is it any trouble with assuming the both *can*
> happen at once?  If something's broken, it will be reflected in the
> output.

Fair point. We may not need to interpret the contents.

On Thu, Jul 28, 2022 at 3:24 PM Kyotaro Horiguchi
<horikyota....@gmail.com> wrote:
>
> 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 ..]
>

I'm concerned that we have two information of subxact apart. Given
that showing both individual subxacts and "overflow" is a bug, I think
we can output like:

    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]);
    }

    if (xlrec->subxid_overflow)
        appendStringInfoString(buf, "; subxid overflowed");

Or we can output the "subxid overwlowed" first.

Regards,

--
Masahiko Sawada
EDB:  https://www.enterprisedb.com/


Reply via email to