Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eAi0k-0001QP-1s for pgsql-committers@arkaria.postgresql.org; Fri, 03 Nov 2017 19:52:14 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eAi0j-0006jm-Ku for pgsql-committers@arkaria.postgresql.org; Fri, 03 Nov 2017 19:52:13 +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 1eAi0i-0006ij-Mh; Fri, 03 Nov 2017 19:52:12 +0000 Received: from smtprelay0221.b.hostedemail.com ([64.98.42.221] helo=smtprelay.b.hostedemail.com) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eAi0f-0006xm-0f; Fri, 03 Nov 2017 19:52:12 +0000 Received: from filter.hostedemail.com (10.5.19.248.rfc1918.com [10.5.19.248]) by smtprelay04.b.hostedemail.com (Postfix) with ESMTP id 0CDCF7B61C; Fri, 3 Nov 2017 19:52:07 +0000 (UTC) X-Session-Marker: 616C76686572726540616C76682E6E6F2D69702E6F7267 X-Spam-Summary: 50,0,0,,d41d8cd98f00b204,alvherre@alvh.no-ip.org,:::::::::::::::::,RULES_HIT:41:355:379:599:800:960:965:966:967:973:988:989:1260:1277:1311:1312:1313:1314:1345:1359:1431:1437:1515:1516:1518:1519:1534:1541:1593:1594:1595:1596:1711:1730:1747:1777:1792:2196:2198:2199:2200:2393:2525:2560:2563:2682:2685:2692:2693:2828:2859:2895:2933:2937:2939:2942:2945:2947:2951:2954:3022:3138:3139:3140:3141:3142:3353:3865:3866:3867:3868:3870:3871:3872:3873:3874:3934:3936:3938:3941:3944:3947:3950:3953:3956:3959:4385:4390:4395:4605:5007:6261:7875:7903:9025:9121:10004:10400:10848:11026:11232:11658:11914:12296:12663:13069:13311:13357:13439:13894:13895:14181:14721:14764:21080:21222:21627:30004:30054:30070,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:2,LUA_SUMMARY:none X-HE-Tag: quill86_69addd392793b X-Filterd-Recvd-Size: 2488 Received: from alvin.alvh.no-ip.org (93-44-184-102.ip98.fastwebnet.it [93.44.184.102]) (Authenticated sender: alvherre@alvh.no-ip.org) by omf12.b.hostedemail.com (Postfix) with ESMTPA; Fri, 3 Nov 2017 19:52:06 +0000 (UTC) Received: by alvin.alvh.no-ip.org (Postfix, from userid 1000) id 226734C5; Fri, 3 Nov 2017 20:52:04 +0100 (CET) Date: Fri, 3 Nov 2017 20:52:04 +0100 From: Alvaro Herrera To: Peter Geoghegan Cc: Andres Freund , "Wood, Dan" , pgsql-committers@postgresql.org, "Wong, Yi Wen" , Michael Paquier , Robert Haas , Tom Lane , pgsql-hackers@postgresql.org Subject: Re: [HACKERS] pgsql: Fix freezing of a dead HOT-updated tuple Message-ID: <20171103195204.omoi4olywmv3nyqk@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20171103193659.GA3404@marmot> User-Agent: NeoMutt/20170306-137-4415bd-dirty (1.8.0) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-committers Precedence: bulk Sender: pgsql-committers-owner@postgresql.org Peter Geoghegan wrote: > 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? > > Can you be more specific about what you mean here? I think that I > understand where you're going with this, but I'm not sure. He means that the tuple that heap_update moves to page 1 (which will no longer be processed by vacuum) will contain a multixact that's older than relminmxid -- because it is copied unchanged by heap_update instead of properly checking against age limit. -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-committers