Re: Improve description of XLOG_RUNNING_XACTS - Mailing list pgsql-hackers

From Masahiko Sawada
Subject Re: Improve description of XLOG_RUNNING_XACTS
Date
Msg-id CAD21AoASYjmCrgiK6RJrubb50Q3zO_8MtfouBArq3KyZN21B=Q@mail.gmail.com
Whole thread Raw
In response to Re: Improve description of XLOG_RUNNING_XACTS  (Kyotaro Horiguchi <horikyota.ntt@gmail.com>)
List pgsql-hackers
Sorry for the late reply.

On Thu, Jul 28, 2022 at 4:29 PM Kyotaro Horiguchi
<horikyota.ntt@gmail.com> wrote:
>
> At Thu, 28 Jul 2022 15:53:33 +0900, Masahiko Sawada <sawada.mshk@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.ntt@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/



pgsql-hackers by date:

Previous
From: Thomas Munro
Date:
Subject: Re: Cleaning up historical portability baggage
Next
From: Michael Paquier
Date:
Subject: Re: fix stale help message