pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Maxim Orlov <m.orlov@postgrespro.ru>
To: Greg Nancarrow <gregn4422@gmail.com>
Cc: Pavel Borisov <pashkin.elfe@gmail.com>
Cc: Michael Paquier <michael@paquier.xyz>
Cc: Pengchengliu <pengchengliu@tju.edu.cn>
Cc: Andres Freund <andres@anarazel.de>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
Date: Fri, 04 Jun 2021 15:30:15 +0300
Message-ID: <09788181118f7bd8000d3bb097e0720f@postgrespro.ru> (raw)
In-Reply-To: <CAJcOf-dX8ufSeCghz9Wg4CrtpJboCxtkqjtK6giLowkwaROcuQ@mail.gmail.com>
References: <CAJcOf-cJfLcgxwz8TeTZqWe3z2XdLkZAT8gHTwgHqHP9-Cb-Mw@mail.gmail.com>
	<AMkAGwA2DuDLiuCUBBPk1KoS.3.1621046249310.Hmail.2008202116@tju.edu.cn>
	<CAJcOf-eDcGVUx0+HjeYzj73AK+x2OOLEQLcfPn4ThEG9pwZpSw@mail.gmail.com>
	<000901d74b84$fa262890$ee7279b0$@tju.edu.cn>
	<CAJcOf-dD-428NkhDKm8GKTDVU97LYUeOd=RazhLR9boxO_ywsA@mail.gmail.com>
	<000801d74d16$150494c0$3f0dbe40$@tju.edu.cn>
	<CAJcOf-dVeKS2YJaS_BVdF7ghQ=xFj2d68TzGjYCvzo8cM0FtDQ@mail.gmail.com>
	<CAJcOf-c63QJ3X7geemcjtkd7ohHM1=7xJYuv8W6LLRAc9DNvOQ@mail.gmail.com>
	<YKswhdCNo6gwn2w2@paquier.xyz>
	<CAJcOf-cNLhA7iaUYAQqZ44tz3oHJoPxGRm1+tNE27iJXTXObzQ@mail.gmail.com>
	<CALT9ZEG4vzW1C=U4-AvgCA9=QEqVfrxaQ8PQ98CGNZ5LBG96kQ@mail.gmail.com>
	<CAJcOf-dX8ufSeCghz9Wg4CrtpJboCxtkqjtK6giLowkwaROcuQ@mail.gmail.com>

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.

---
Best regards,
Maxim Orlov.

Attachments:

max-cached-subxibds.patch (text/x-diff, 1015B) download 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; diff --git a/src/include/storage/proc.h b/src/include/storage/proc.h index be67d8a8616..8e1a3d1c6bb 100644 --- a/src/include/storage/proc.h +++ b/src/include/storage/proc.h @@ -33,7 +33,7 @@ * listed anywhere in the PGPROC array is not a running transaction. Else we * have to look at pg_subtrans. */ -#define PGPROC_MAX_CACHED_SUBXIDS 64 /* XXX guessed-at value */ +#define PGPROC_MAX_CACHED_SUBXIDS 120 /* XXX guessed-at value */ typedef struct XidCacheStatus {

view thread (62+ messages)  latest in thread

Message-ID: <09788181118f7bd8000d3bb097e0720f@postgrespro.ru>
Permalink:  ../09788181118f7bd8000d3bb097e0720f@postgrespro.ru/
Also on:    postgresql.org/message-id/09788181118f7bd8000d3bb097e0720f@postgrespro.ru

 ·  · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: m.orlov@postgrespro.ru, gregn4422@gmail.com, pashkin.elfe@gmail.com, michael@paquier.xyz, pengchengliu@tju.edu.cn, andres@anarazel.de
  Subject: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump
  In-Reply-To: <09788181118f7bd8000d3bb097e0720f@postgrespro.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox