Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGQWo-0001qZ-8d for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2019 16:01:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGQWn-0001II-4p for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2019 16:01:45 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGQWm-0001IB-PD for pgsql-hackers@lists.postgresql.org; Tue, 16 Apr 2019 16:01:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGQWk-0008I4-9L for pgsql-hackers@postgresql.org; Tue, 16 Apr 2019 16:01:43 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id x3GG1a00030117; Tue, 16 Apr 2019 12:01:36 -0400 From: Tom Lane To: Robert Haas cc: Masahiko Sawada , Kyotaro HORIGUCHI , "Bossart, Nathan" , Alvaro Herrera , PostgreSQL-development Subject: Re: New vacuum option to do only freezing In-reply-to: References: <20190403.131702.71087088.horiguchi.kyotaro@lab.ntt.co.jp> <20190404.091743.76975665.horiguchi.kyotaro@lab.ntt.co.jp> <15751.1555256860@sss.pgh.pa.us> <16814.1555348381@sss.pgh.pa.us> <23885.1555357618@sss.pgh.pa.us> <28991.1555376836@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Tue, 16 Apr 2019 10:26:08 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <30115.1555430496.1@sss.pgh.pa.us> Date: Tue, 16 Apr 2019 12:01:36 -0400 Message-ID: <30116.1555430496@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Robert Haas writes: > On Mon, Apr 15, 2019 at 9:07 PM Tom Lane wrote: >> If we're failing to remove it, and it's below the desired freeze >> horizon, then we'd darn well better freeze it instead, no? > I don't know that that's safe. IIRC, the freeze code doesn't cope > nicely with being given a tuple that actually ought to have been > deleted. It'll just freeze it anyway, which is obviously bad. Looking at heap_prepare_freeze_tuple, it looks to me like it'd notice the problem and throw an error. The two possible reasons for a tuple to be dead are xmin aborted and xmax committed, right? There are tests in there that will complain if either of those is true and the xid is below the freeze horizon. Given that we don't get here except when the tuple has just become dead, it probably is all right to assume that it can't possibly get selected for freezing, and let those tests backstop the assumption. (BTW, I don't understand why that code will throw "found xmin %u from before relfrozenxid %u" if HeapTupleHeaderXminFrozen is true? Shouldn't the whole if-branch at lines 6113ff be skipped if xmin_frozen?) regards, tom lane PS: I see that mandrill just replicated the topminnow failure that started this discussion.