Re: Parallel scan with SubTransGetTopmostTransaction assert coredump

From: Ranier Vilela <ranier(dot)vf(at)gmail(dot)com>
To: Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Cc: m(dot)orlov(at)postgrespro(dot)ru, gregn4422(at)gmail(dot)com, pashkin(dot)elfe(at)gmail(dot)com, Michael Paquier <michael(at)paquier(dot)xyz>, pengchengliu(at)tju(dot)edu(dot)cn, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Date: 2021-06-04 14:47:52
Message-ID: CAEudQAoRbXiM4dMRFvHevNt+PKcWJ495PiJvPV=7gVyOdHQvUw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

>Just a note here. After examining the core dump I did notice something.

>While in XidInMVCCSnapshot call the snapshot->suboverflowed is set true
>although subxip == NULL and subxcnt == 0. As far as I understand,
>snapshot->suboverflowed is set true in the GetRunningTransactionData
>call.

>And then I decided to put elog around CurrentRunningXacts->subxcnt's
>assigment.
>diff --git a/src/backend/storage/ipc/procarray.c
>b/src/backend/storage/ipc/procarray.c
>index 42a89fc5dc9..3d2db02f580 100644
>--- a/src/backend/storage/ipc/procarray.c
>+++ b/src/backend/storage/ipc/procarray.c
>@@ -2781,6 +2781,9 @@ GetRunningTransactionData(void)
> * increases if slots do.
> */

>+ if (suboverflowed)
>+ elog(WARNING, " >>> CurrentRunningXacts->subxid_overflow
>is true");
>+
> CurrentRunningXacts->xcnt = count - subcount;
> CurrentRunningXacts->subxcnt = subcount;
> CurrentRunningXacts->subxid_overflow = suboverflowed;

>... and did get a bunch of messages. I.e. subxid_overflow is set true
>very often.

>I've increased the value of PGPROC_MAX_CACHED_SUBXIDS. Once it becomes
>more than 120 there are no messages and no failed assertions are
>provided any more.

Please, avoid using decimal based values.

128 is multiple of 64.

See :

https://github.com/trevstanhope/scratch/blob/master/C/docs/O%27Reilly%20-%20Practical%20C%20Programming%203rd%20Edition.pdf

15.6.1 The Power of Powers of 2

regards,

Ranier Vilela

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2021-06-04 14:56:12 Re: Race condition in recovery?
Previous Message Bharath Rupireddy 2021-06-04 14:39:46 Re: Incorrect usage of strtol, atoi for non-numeric junk inputs