Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePeMf-0008G9-5O for pgsql-committers@arkaria.postgresql.org; Fri, 15 Dec 2017 01:00:37 +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 1ePeMe-0002Mp-NR for pgsql-committers@arkaria.postgresql.org; Fri, 15 Dec 2017 01:00:36 +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 1ePeMe-0002Mc-7R; Fri, 15 Dec 2017 01:00:36 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ePeMb-00022X-CH; Fri, 15 Dec 2017 01:00:35 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 79EE620CD4; Thu, 14 Dec 2017 20:00:31 -0500 (EST) Received: from frontend1 ([10.202.2.160]) by compute5.internal (MEProxy); Thu, 14 Dec 2017 20:00:31 -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=Th1OZnUAFxzZJBf6oM71kELWyHv0C GUGgY8w8Sy9DXc=; b=hR/7z6PvXU4RQAmdDZpmPhKObqtkFQd9VD8uTr4GAG7uB 66AMd9GIZmdU0UEKHG9CJtvpF2lKXJVbxlM0RJ+/lIqVz+fYEgBopX7uyvzmUSQM uUn5hyWa8F6CBGXCFyRB8IdPy9T8/sv85mGkzzkneTnxf2zRRHici6TYsLXTkwKH Beklj64eSvTbvbxy8yvTo5v0kkjVUIZU6gCekTmNRQgAAY6w7wtcI/Us03FZKgRe bp8TsMKqR5oZQiTmA+OtVpSuP5SEvF/rNqwXXrczYEY6S8R/H39Gi9rS3HaaJnOU rG586sDhf2PRjz3TwtRrLnH+69qo0hL1vJRn2wpyw== X-ME-Sender: Received: from intern.anarazel.de (75-144-246-5-sfba.hfc.comcastbusiness.net [75.144.246.5]) by mail.messagingengine.com (Postfix) with ESMTPA id E75FF7E31F; Thu, 14 Dec 2017 20:00:30 -0500 (EST) Date: Thu, 14 Dec 2017 17:00:29 -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: <20171215010029.3dxx56vjlymudvwo@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 Hi, On 2017-11-13 19:03:41 -0800, Andres Freund wrote: > diff --git a/src/backend/access/heap/rewriteheap.c b/src/backend/access/heap/rewriteheap.c > index f93c194e182..7d163c91379 100644 > --- a/src/backend/access/heap/rewriteheap.c > +++ b/src/backend/access/heap/rewriteheap.c > @@ -407,7 +407,10 @@ rewrite_heap_tuple(RewriteState state, > * While we have our hands on the tuple, we may as well freeze any > * eligible xmin or xmax, so that future VACUUM effort can be saved. > */ > - heap_freeze_tuple(new_tuple->t_data, state->rs_freeze_xid, > + heap_freeze_tuple(new_tuple->t_data, > + state->rs_old_rel->rd_rel->relfrozenxid, > + state->rs_old_rel->rd_rel->relminmxid, > + state->rs_freeze_xid, > state->rs_cutoff_multi); Hm. So this requires backpatching the introduction of RewriteStateData->rs_old_rel into 9.3, which in turn requires a new argument to begin_heap_rewrite(). It originally was added in the logical decoding commit (i.e. 9.4). I'm fine with that, but it could theoretically cause issues for somebody with an extension that calls begin_heap_rewrite() - which seems unlikely and I couldn't find any that does so. Does anybody have a problem with that? Regards, Andres