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 1l2ALl-0005jC-QN for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Jan 2021 10:04:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2ALk-00050h-OD for pgsql-bugs@arkaria.postgresql.org; Wed, 20 Jan 2021 10:04:28 +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 1l2ALk-00050Z-Dk for pgsql-bugs@lists.postgresql.org; Wed, 20 Jan 2021 10:04:28 +0000 Received: from meesny.iki.fi ([2001:67c:2b0:1c1::201]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2ALi-0007vO-8n for pgsql-bugs@lists.postgresql.org; Wed, 20 Jan 2021 10:04:28 +0000 Received: from [192.168.1.113] (dsl-hkibng22-54faa4-119.dhcp.inet.fi [84.250.164.119]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) (Authenticated sender: hlinnaka) by meesny.iki.fi (Postfix) with ESMTPSA id 58C2B203D5; Wed, 20 Jan 2021 12:04:24 +0200 (EET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1611137064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M25NeAD1UmcWSJTxQ/Z/3aXDxcZbHjNMVLUXVj6HZ/I=; b=x340br3klAkkUwv/s4OB4KZ/IYB7/qWazrF9AT91Bz4v2W2VQfgq0yfhpGkf8DMBfYJd4L N3lKQasJTW+qIukCXAiUsFbYG30Z/gyfjteuEBzxobM1MBTRtlyCX5n+4ucaYsrTXG1sK/ ZnnBLOUd7RLkwgeBDh+qZpzYbLjP9+w= Subject: Re: Reproducible GIST index corruption under concurrent updates To: Duncan Sands , Andrey Borodin Cc: pgsql-bugs@lists.postgresql.org References: <28663562-8489-4680-BC26-CAEADEB258D1@yandex-team.ru> <132baf64-3764-0351-750e-0443e74f1052@iki.fi> <907491b3-87c7-aadd-3fb1-be3c542b7fb7@iki.fi> <55ea6133-f2d1-0cc5-8ce5-333e373164ba@deepbluecap.com> From: Heikki Linnakangas Message-ID: Date: Wed, 20 Jan 2021 12:04:23 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: <55ea6133-f2d1-0cc5-8ce5-333e373164ba@deepbluecap.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit ARC-Seal: i=1; s=meesny; d=iki.fi; t=1611137064; a=rsa-sha256; cv=none; b=G+0IAvoUbeDmN395GFTKigaRZ0UlNKB3993DfRG/jkNRgx895yXdKM/s3wkKogF+KlP/SB 6ABoAZGUkg0la7/yaz9ITMdOcFFM39LskVaiVfDGeFoxhnvfEtf8w7i8t7hebX8ojpSRLQ vhg5b59+z6LFG5NjyU4T6NrK4IUc4Wg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=iki.fi; s=meesny; t=1611137064; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=M25NeAD1UmcWSJTxQ/Z/3aXDxcZbHjNMVLUXVj6HZ/I=; b=RSO0jYO1fPfiJ3ZSl04+RCk58CIkvgrIYuW1kKAobfXhnE84MppmXCh2BepVBdZOzZfw2O i3wSK7oK43DyAwq/OOuDSELc+XYHC5mgMyiuc3Mj1SWNMm350C0YfGyqIYde4yFY5mQrfC 9isArYWmdA2gkWDYt77jxU6qJf6XNPY= ARC-Authentication-Results: i=1; ORIGINATING; auth=pass smtp.auth=hlinnaka smtp.mailfrom=hlinnaka@iki.fi List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 20/01/2021 10:23, Duncan Sands wrote: >> The comment change was correct, but the condition used &&. Should've been ||. >> There is another copy of basically the same condition earlier in the function >> that was changed correctly, but I blundered this one. Oops. >> >> The attached patch fixes this. I also added an assertion to the >> gistplacetopage() function, to check that we never try to insert on a deleted >> page. This bug could've made that happen too, although in this case the problem >> was a concurrent split, not a deletion. I'll backpatch and push this tomorrow. >> >> Many thanks for the easy reproducer script, Duncan! > > No problem Heikki, thanks for the quick fix. Pushed as commit 6b4d3046f4, and backpatched down to version 12, where this bug was introduced. It will appear in the next minor release. - Heikki