Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lp8xy-0004UR-9u for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jun 2021 12:30:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lp8xw-0006ms-E9 for pgsql-hackers@arkaria.postgresql.org; Fri, 04 Jun 2021 12:30:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lp8xw-0006mk-46 for pgsql-hackers@lists.postgresql.org; Fri, 04 Jun 2021 12:30:20 +0000 Received: from mail.postgrespro.ru ([93.174.131.139]) by magus.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lp8xt-0006xu-Ii for pgsql-hackers@postgresql.org; Fri, 04 Jun 2021 12:30:19 +0000 Received: from mail.postgrespro.ru (cyclops.postgrespro.ru [93.174.131.138]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) by mail.postgrespro.ru (Postfix) with ESMTPSA id D488721C81EF; Fri, 4 Jun 2021 15:30:15 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=postgrespro.ru; s=mail; t=1622809815; bh=L7+TzEoOTIpq6gzFd/n/02r1RZ/9IBSif+n2I0TRND4=; h=Date:From:To:Cc:Subject:In-Reply-To:References; b=PKkP/9q0tXDDN03X5/JhqXiJxioC0jxCOGPmVqsZWgwDg2gHlHYltN3QqCMB5IeHC s3ZuGd0FqGd6oGhLXB+qX1qYv+lDLvVF7L3swkQGAhhS6tRAXOThcVZrDSTOSikEHD /c406ybpE65RZOvKIFGgHf71Whs1Zhsawv0Nvjx4= MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=_eed9393211e9f9a3ae11d42abc140cd9" Content-Transfer-Encoding: 8bit Date: Fri, 04 Jun 2021 15:30:15 +0300 From: Maxim Orlov To: Greg Nancarrow Cc: Pavel Borisov , Michael Paquier , Pengchengliu , Andres Freund , PostgreSQL-development Subject: Re: Parallel scan with SubTransGetTopmostTransaction assert coredump In-Reply-To: References: <000901d74b84$fa262890$ee7279b0$@tju.edu.cn> <000801d74d16$150494c0$3f0dbe40$@tju.edu.cn> User-Agent: Roundcube Webmail/1.4.0 Message-ID: <09788181118f7bd8000d3bb097e0720f@postgrespro.ru> X-Sender: m.orlov@postgrespro.ru List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --=_eed9393211e9f9a3ae11d42abc140cd9 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8; format=flowed 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. --=_eed9393211e9f9a3ae11d42abc140cd9 Content-Transfer-Encoding: base64 Content-Type: text/x-diff; name=max-cached-subxibds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