Re: Max connections reached without max connections reached - Mailing list pgsql-general

From Dilip Kumar
Subject Re: Max connections reached without max connections reached
Date
Msg-id CAFiTN-v6FrBe9FTtZa-CT0r7UViWEz0_5ziU7k6cOHPhFsyMvA@mail.gmail.com
Whole thread Raw
In response to Re: Max connections reached without max connections reached  (Dilip Kumar <dilipbalaut@gmail.com>)
List pgsql-general
On Thu, Dec 2, 2021 at 9:35 AM Dilip Kumar <dilipbalaut@gmail.com> wrote:

> I think there is no such view or anything which tells about which
> backend or transaction has more than 64 sub transaction.  But if we
> are ready to modify the code then we can LOG that information in
> GetNewTransactionId(), when first time we are marking it overflown.
> if (nxids < PGPROC_MAX_CACHED_SUBXIDS)
> {
>    MyProc->subxids.xids[nxids] = xid;
>   pg_write_barrier();
>   MyProc->subxidStatus.count = substat->count = nxids + 1;
> }
> else
> {
>   MyProc->subxidStatus.overflowed = substat->overflowed = true;
>  <-- we can log or put breakpoint here and identify which statement is
> creating oeverflow-->
> }
>
> IMHO, it is good to LOG such information if we are not already logging
> this anywhere.
>

I have prepared a small patch to log this information.

-- 
Regards,
Dilip Kumar
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-general by date:

Previous
From: Yi Sun
Date:
Subject: Re: ssl_crl_file Certificate Revocation List doesn't work for postgresql 11
Next
From: Daniel Frey
Date:
Subject: libpq: Which functions may hang due to network issues?