Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipiLf-0004sj-Lg for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 00:40:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1ipiLd-0002wA-1x for pgsql-hackers@arkaria.postgresql.org; Fri, 10 Jan 2020 00:40:21 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1ipiLc-0002w0-Lg for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 00:40:20 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ipiLa-0004Ox-CT for pgsql-hackers@lists.postgresql.org; Fri, 10 Jan 2020 00:40:19 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id 00A0eCAV018118; Thu, 9 Jan 2020 19:40:13 -0500 From: Tom Lane To: Amit Kapila cc: Noah Misch , Amit Khandekar , Alvaro Herrera from 2ndQuadrant , Andres Freund , =?UTF-8?Q?Juan_Jos=C3=A9_Santamar=C3=ADa_Flecha?= , PostgreSQL Hackers , Robert Haas , Thomas Munro , Tomas Vondra Subject: Re: logical decoding : exceeded maxAllocatedDescs for .spill files In-reply-to: <14739.1578613901@sss.pgh.pa.us> References: <20200104185148.GA2270238@rfd.leadboat.com> <20200109053704.GA2502006@rfd.leadboat.com> <22498.1578548741@sss.pgh.pa.us> <14739.1578613901@sss.pgh.pa.us> Comments: In-reply-to Tom Lane message dated "Thu, 09 Jan 2020 18:51:41 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <18116.1578616812.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 09 Jan 2020 19:40:12 -0500 Message-ID: <18117.1578616812@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk I wrote: > ReorderBuffer: 223302560 total in 26995 blocks; 7056 free (3 c= hunks); 223295504 used > The test case is only inserting 50K fairly-short rows, so this seems > like an unreasonable amount of memory to be consuming for that; and > even if you think it's reasonable, it clearly isn't going to scale > to large production transactions. > Now, the good news is that v11 and later get through > 006_logical_decoding.pl just fine under the same restriction. > So we did something in v11 to fix this excessive memory consumption. > However, unless we're willing to back-port whatever that was, this > test case is clearly consuming excessive resources for the v10 branch. I dug around a little in the git history for backend/replication/logical/, and while I find several commit messages mentioning memory leaks and faulty spill logic, they all claim to have been back-patched as far as 9.4. It seems reasonably likely to me that this result is telling us about an actual bug, ie, faulty back-patching of one or more of those fixes into v10 and perhaps earlier branches. I don't know this code well enough to take point on looking for the problem, though. regards, tom lane