Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEWVG-0006Kq-0D for pgsql-committers@arkaria.postgresql.org; Tue, 14 Nov 2017 08:23:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEWVF-0006m3-8M for pgsql-committers@arkaria.postgresql.org; Tue, 14 Nov 2017 08:23:29 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eEWVE-0006ll-P0; Tue, 14 Nov 2017 08:23:29 +0000 Received: from out4-smtp.messagingengine.com ([66.111.4.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eEWV6-0005dd-RP; Tue, 14 Nov 2017 08:23:27 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 7A7852117E; Tue, 14 Nov 2017 03:23:19 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Tue, 14 Nov 2017 03:23:19 -0500 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-sender :x-me-sender:x-sasl-enc; s=fm1; bh=qbZE000gQpAPg5LkhLUcZSnerFkCg WiufwRbmsl+Wrs=; b=pPQAoUrXR0jz/KHKs6tP43/2Cjwki8eEAoH32cIxaW0+H CfjbQEhbDN1brAmH9E9j7F9p1d6jCeqn7Z3iO/KV9EPcI1MP2Hivpu/FdZ1B4z2/ X2n8W7mgAmDRVQxbkMKiMPx8GXE/yNIB6YJVzwABXnaOewnE1aqEolX5v/MzuIGw DcHCVeYI2ayrivIjNZSu7DDFNAA8t0fgLyW3DqrznJwlj5e0TOfoDtzLf0kJN1o9 pMn4beaf75TMtd/9kNAqSWvABPHJRz6WVd6oeA5KJsNpgBUJHjzRKPrsR0SUua2i bqecq6oBnt+KOGd0yoyhOUy6KH6v6ACpAhQhQdjwA== X-ME-Sender: Received: from intern.anarazel.de (unknown [136.24.76.189]) by mail.messagingengine.com (Postfix) with ESMTPA id 33D74247A5; Tue, 14 Nov 2017 03:23:19 -0500 (EST) Date: Tue, 14 Nov 2017 00:23:18 -0800 From: Andres Freund To: Alvaro Herrera Cc: "Wood, Dan" , Peter Geoghegan , pgsql-committers@postgresql.org, "Wong, Yi Wen" , Michael Paquier , Robert Haas , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple Message-ID: <20171114082318.35hp62dendwrsxhd@alap3.anarazel.de> References: <20171102112019.33wb7g5wp4zpjelu@alap3.anarazel.de> <20171102124947.hshl7znx6ixy62pf@alvherre.pgsql> <20171102130551.i2w33sqdw3bdvetn@alap3.anarazel.de> <20171103145330.5ycjoje5s6lfwxps@alap3.anarazel.de> <20171114030341.movhteyakqeqx5pm@alap3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171114030341.movhteyakqeqx5pm@alap3.anarazel.de> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2017-11-13 19:03:41 -0800, Andres Freund wrote: > > Staring at the vacuumlazy hunk I think I might have found a related bug: > > heap_update_tuple() just copies the old xmax to the new tuple's xmax if > > a multixact and still running. It does so without verifying liveliness > > of members. Isn't that buggy? Consider what happens if we have three > > blocks: 1 has free space, two is being vacuumed and is locked, three is > > full and has a tuple that's key share locked by a live tuple and is > > updated by a dead xmax from before the xmin horizon. In that case afaict > > the multi will be copied from the third page to the first one. Which is > > quite bad, because vacuum already processed it, and we'll set > > relfrozenxid accordingly. I hope I'm missing something here? > > Trying to write a testcase for that now. This indeed happens, but I can't quite figure out a way to write an isolationtester test for this. The problem is that to have something reproducible one has to make vacuum block on a cleanup lock, but that currently doesn't register as waiting for the purpose of isolationtester's logic. Greetings, Andres Freund