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 1lheLZ-0003D6-EO for pgsql-hackers@arkaria.postgresql.org; Fri, 14 May 2021 20:23:45 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lheLY-0003JS-7O for pgsql-hackers@arkaria.postgresql.org; Fri, 14 May 2021 20:23:44 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lheLX-0003HF-W7 for pgsql-hackers@lists.postgresql.org; Fri, 14 May 2021 20:23:43 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lheLW-0006lr-27 for pgsql-hackers@lists.postgresql.org; Fri, 14 May 2021 20:23:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 14EKNb4E2192151; Fri, 14 May 2021 16:23:37 -0400 From: Tom Lane To: Alvaro Herrera cc: Pavel Borisov , Dilip Kumar , PostgreSQL Hackers Subject: Re: OOM in spgist insert In-reply-to: <20210513155351.GA7848@alvherre.pgsql> References: <20210513155351.GA7848@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Thu, 13 May 2021 11:53:51 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2192149.1621023817.1@sss.pgh.pa.us> Date: Fri, 14 May 2021 16:23:37 -0400 Message-ID: <2192150.1621023817@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > This comment made me remember a patch I've had for a while, which splits > the CHECK_FOR_INTERRUPTS() definition in two -- one of them is > INTERRUPTS_PENDING_CONDITION() which let us test the condition > separately; that allows the lock we hold to be released prior to > actually processing the interrupts. I've now pushed that macro change ... > The btree code modified was found to be an actual problem in production > when a btree is corrupted in such a way that vacuum would get an > infinite loop. I don't remember the exact details but I think we saw > vacuum running for a couple of weeks, and had to restart the server in > order to terminate it (since it wouldn't respond to signals). ... but I think this bit still needs work, if we still want it at all. The problem is that it seems to believe that ProcessInterrupts is guaranteed not to return, which is far from the truth. Maybe it was true once, but we've grown a lot of accretions on it that will just clear InterruptPending and return. I see that the "return false" leads directly to an "Assert(false)", which seems unhelpful. regards, tom lane