Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ePbYH-0005Gp-3C for pgsql-committers@arkaria.postgresql.org; Thu, 14 Dec 2017 22:00:25 +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 1ePbYG-0001yq-C3 for pgsql-committers@arkaria.postgresql.org; Thu, 14 Dec 2017 22:00:24 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1ePbYF-0001yd-Vc; Thu, 14 Dec 2017 22:00:24 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1ePbYC-00077j-Tl; Thu, 14 Dec 2017 22:00:23 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 0DA6E20F27; Thu, 14 Dec 2017 17:00:19 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute5.internal (MEProxy); Thu, 14 Dec 2017 17:00: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=dYknK7Q0i3GHaSBTw+idU2stFSMXb D+71OVxbkj9etI=; b=B6gdYOdnvbBWsfRWVQiWHEVq4m6xtVkqjWN7eLBqoBP6/ G7ZYZf8GtO7R6FR2QZGdQB4p42vgmIDbpgGSqAzCQePZuGwT7RH6ixH+hoK9ova2 +xqNoiS4iW3mCEm5RLzscoeVVwJ5UXH0AE7WKXeh+lorfaspUJ3WM7BbHZ25qvJ5 Mg4UTHoYTx3VSZiZnaZTv/gXtU0N8wtIzNNiCebfq2FcFE9yK7aqzntEksaw7Xrj fSr8u6k6ogIMydugqcxpuR+x3ngqXiqSXJPgGlxM8Aw2QA3Tqz/MwnQHQ9IPGa2V LTi+37i/1VJHcd/VuD4p14j7+isUrIFgSj12gN94A== 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 AFC81241E2; Thu, 14 Dec 2017 17:00:18 -0500 (EST) Date: Thu, 14 Dec 2017 14:00:17 -0800 From: Andres Freund To: Michael Paquier Cc: Alvaro Herrera , "Wood, Dan" , Peter Geoghegan , pgsql-committers@postgresql.org, "Wong, Yi Wen" , Robert Haas , Tom Lane , PostgreSQL mailing lists Subject: Re: [HACKERS] [COMMITTERS] pgsql: Fix freezing of a dead HOT-updated tuple Message-ID: <20171214220017.6dax6ne7ru4ggadr@alap3.anarazel.de> References: <20171114030341.movhteyakqeqx5pm@alap3.anarazel.de> <20171206202355.byfh6g3bezy4rrcr@alvherre.pgsql> 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: Precedence: bulk On 2017-12-07 18:32:51 +0900, Michael Paquier wrote: > On Thu, Dec 7, 2017 at 5:23 AM, Alvaro Herrera wrote: > > Looking at 0002: I agree with the stuff being done here. > > The level of details you are providing with a proper error code is an > improvement over the first version proposed in my opinion. > > > I think a > > couple of these checks could be moved one block outerwards in term of > > scope; I don't see any reason why the check should not apply in that > > case. I didn't catch any place missing additional checks. > > In FreezeMultiXactId() wouldn't it be better to issue an error as well > for this assertion? > Assert(!TransactionIdPrecedes(members[i].xid, cutoff_xid)); I'm not really concerned that much about pure lockers, they don't cause permanent data corruption... > > Despite these being "shouldn't happen" conditions, I think we should > > turn these up all the way to ereports with an errcode and all, and also > > report the XIDs being complained about. No translation required, > > though. Other than those changes and minor copy editing a commit > > (attached), 0002 looks good to me. If you want to go around doing that in some more places we can do so in master only... > + if (!(tuple->t_infomask & HEAP_XMAX_LOCK_ONLY) && > + TransactionIdDidCommit(xid)) > + ereport(ERROR, > + (errcode(ERRCODE_DATA_CORRUPTED), > + errmsg("can't freeze committed xmax %u", xid))); > The usual wording used in errmsg is not the "can't" but "cannot". > > + ereport(ERROR, > + (errcode(ERRCODE_DATA_CORRUPTED), > + errmsg_internal("uncommitted Xmin %u from > before xid cutoff %u needs to be frozen", > + xid, cutoff_xid))); > "Xmin" I have never seen, but "xmin" I did. Changed... Greetings, Andres Freund