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 1lhK9G-0002Ll-1r for pgsql-hackers@arkaria.postgresql.org; Thu, 13 May 2021 22:49:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lhK9E-0001cx-RY for pgsql-hackers@arkaria.postgresql.org; Thu, 13 May 2021 22:49:40 +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 1lhK9D-0001co-PQ for pgsql-hackers@lists.postgresql.org; Thu, 13 May 2021 22:49:40 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lhK9B-0004ak-LS for pgsql-hackers@lists.postgresql.org; Thu, 13 May 2021 22:49:38 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id B4F405C01B1; Thu, 13 May 2021 18:49:36 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 13 May 2021 18:49:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm2; bh=7Z/ACYRtiIrG6spe9iQLUfuLEAADeLVn3a9jZpG8Yv4=; b=uuWOszSW PEvvmpzLnz/EF8LlY+hdKKuB7Ux/d8bRoWZN6xKniPE68codh+Vr98FbA05CmEiE oDtxJTPENz0UHMSIVrenx8YWmRKnDl/KLuKYnz2Uj+RO3WnsWPZjcRFh5Q+p4MH2 lA5j5WUHKLEyLMgFistRTChDjAHbCYxdpss/snp9rYMTrHRwCgnajRfe9QRCYSRo 3QqE1w2w2UTSQAqeEA6Zz+varsKYh9st4u9tAVXgbrpF8QukYXp5LxWHN3GG3abq 7vNIdJs2DnwAWDNnLO2B4ok+PnpRvXWdkTTFHRLLWN7A6tg950fPKH/UzV9mv/eT eg47ErAkpGGoGw== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdehhedgudefucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesthekredttderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhepueffhfejieeuueffgedvudekgeeltdeviedvieeufeei ieevgfetheeufeethedvnecukfhppeduledtrdelhedrudelrdelheenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.95]) by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 13 May 2021 18:49:35 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 5CA062A0ADC; Thu, 13 May 2021 18:49:33 -0400 (-04) Date: Thu, 13 May 2021 18:49:33 -0400 From: Alvaro Herrera To: Tom Lane Cc: Pavel Borisov , Dilip Kumar , PostgreSQL Hackers Subject: Re: OOM in spgist insert Message-ID: <20210513224933.GA20201@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1724899.1620944427@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2021-May-13, Tom Lane wrote: > What do people think about back-patching this? In existing branches, > we've defined it to be an opclass bug if it fails to shorten the leaf > datum enough. But not having any defenses against that seems like > not a great idea. OTOH, the 10-cycles-to-show-progress rule could be > argued to be an API break. I think if the alternative is to throw an error, we can afford to retry quite a few more times than 10 in order not have that called an API break. Say, retry (MAXIMUM_ALIGNOF << 3) times or so (if you want to parameterize on maxalign). It's not like this is going to be a performance drag where not needed .. but I think leaving back-branches unfixed is not great. I did run Dilip's test case as well as your new regression test, and both work as intended with your new code (and both OOM-crash the original code). -- Álvaro Herrera Valdivia, Chile