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 1mkJNS-0003ag-Q1 for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Nov 2021 05:08:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mkJNO-0002Ko-Us for pgsql-bugs@arkaria.postgresql.org; Tue, 09 Nov 2021 05:08:54 +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 1mkJNN-0002Kf-Q1 for pgsql-bugs@lists.postgresql.org; Tue, 09 Nov 2021 05:08:54 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mkJNL-0006UI-Sf for pgsql-bugs@lists.postgresql.org; Tue, 09 Nov 2021 05:08:52 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id C25ED5C0297; Tue, 9 Nov 2021 00:08:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 09 Nov 2021 00:08:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=Y2hnu78t8yb04U33PEr4hvi+MJq VT1R82xx1jOn2x34=; b=oelIzyix6sJvEAxumB49L53qwDxog1ykUbHg9etgwKb znyMMz5SQFPEWbI6/WcMDJubAKOLPiwpW75jhKuDTiVNvUjQpFl2H+1chEFPFkd7 ESqT8sUi5rIpPg/3CQ9Ip22XBNDSU/DG2q9cN3phTBj3SMEnqgitoJvPIBMwbAWj N12ikdKFS0st4N94ZAj/LJCQM8eZdxMbdeV4sF5Vo86i3GCV/Kgn89JAtXoqL2w0 7wchm1UNAITTSu3KL+Zjvv+shVQY0yoWbYgPLTy/siCAaTYWUQSygBOMWh8+QnVq ehvoEdPoSokUgP6Uni54IIdw1H6pOcZsNOtjgrra2zw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Y2hnu7 8t8yb04U33PEr4hvi+MJqVT1R82xx1jOn2x34=; b=XJND2A1GPtSzZVO6PN5vhM 9TGTN4TejzqUFPhhj6ag3hdz7y/QGg5UabCZSha/XulSZ6qeqdOVoNozzdkIxJ3K 81xH9Ycnk2Rb0+y2j186NgiATphxfq4sfQ63xQleqvsMJdDMypQSXN0mVD2VzIp2 f+lp9wrq3R5dynuoqXDsTuVMrDKms9KgLJGHn2RmfJZpWn8lIvbTmOfA+cjxfYuw 10EbM2nI/jYYu5j4tL6v9ds7wyLwpmHPxSUuwfFlEHrAr071vpG6arxcms1gYlKH 2/xRcnSr9xBu+wVaauYBWp2virDfIzPOkCOa8FG6PPgZcmMBjhZuzjBAd754d4Ow == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudefgdejhecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkfhggtggujgesthdtredttddtvdenucfhrhhomheptehnughrvghs ucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecuggftrfgrth htvghrnhepudekhfekleeugeevteehleffffejgeelueduleeffeeutdelffeujeffhfeu ffdunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprg hnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 9 Nov 2021 00:08:50 -0500 (EST) Date: Mon, 8 Nov 2021 21:08:48 -0800 From: Andres Freund To: Michael Paquier Cc: Noah Misch , Alexey Ermakov , Robert Haas , Maxim Boguk , PostgreSQL mailing lists , Peter Geoghegan Subject: Re: BUG #17268: Possible corruption in toast index after reindex index concurrently Message-ID: <20211109050848.oe3u6mhtomkaoxrx@alap3.anarazel.de> References: <366f7247-709e-c07c-4875-068be1121c3a@dataegret.com> <20211108183646.r3y6pldylxngxwl4@alap3.anarazel.de> <20211108185317.fz42txmnkqdkpix6@alap3.anarazel.de> <20211108203641.whpia3pzjofellf4@alap3.anarazel.de> <20211109035624.GA940092@rfd.leadboat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2021-11-09 14:02:19 +0900, Michael Paquier wrote: > On Mon, Nov 08, 2021 at 08:37:58PM -0800, Andres Freund wrote: > > On November 8, 2021 7:56:24 PM PST, Noah Misch wrote: > >> On Mon, Nov 08, 2021 at 12:36:41PM -0800, Andres Freund wrote: > >>> One possible way to fix this would be to make ReindexRelationConcurrently() > >>> acquire a lock on the underlying table when reindexing a toast table. Another > >>> to not release the lock in toast_save_datum(). > > Thanks for the test case. That reproduces really quickly. > > >> The latter is more future-proof. Does it have material disadvantages? > > > > I don't immediately see any. But I've been long of the opinion, and > > had plenty discussions around it, that our habit of releasing locks > > early is far too widely used. > > Yes, I'd agree that not patching the reindex concurrent path would be > safer in the long run. This feels a bit like e629a01, in spirit, not > in scope. I wonder if we should do both... Greetings, Andres Freund