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 1hGQA1-0000rb-Dy for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2019 15:38:13 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1hGQ9z-0002t2-Jp for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Apr 2019 15:38:11 +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_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGQ9z-0002sv-BB for pgsql-hackers@lists.postgresql.org; Tue, 16 Apr 2019 15:38:11 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1hGQ9x-0001M6-5v for pgsql-hackers@postgresql.org; Tue, 16 Apr 2019 15:38:10 +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 x3GFc1Mc029205; Tue, 16 Apr 2019 11:38:01 -0400 From: Tom Lane To: Alvaro Herrera cc: Robert Haas , Masahiko Sawada , Kyotaro HORIGUCHI , "Bossart, Nathan" , PostgreSQL-development Subject: Re: New vacuum option to do only freezing In-reply-to: <20190416145434.GA23796@alvherre.pgsql> References: <20190416145434.GA23796@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Tue, 16 Apr 2019 10:54:34 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <29203.1555429081.1@sss.pgh.pa.us> Date: Tue, 16 Apr 2019 11:38:01 -0400 Message-ID: <29204.1555429081@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Alvaro Herrera writes: > On 2019-Apr-16, Robert Haas wrote: >> 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. > Umm, but if we fail to freeze it, we'll leave a tuple around that's > below the relfrozenxid for the table, causing later pg_commit to be > truncated and error messages saying that the tuple cannot be read, no? Yeah. If you think that it's unsafe to freeze the tuple, then this entire patch is ill-conceived and needs to be reverted. I don't know how much more plainly I can put it: index_cleanup cannot be a license to ignore the freeze horizon. (Indeed, I do not quite see what the point of the feature is otherwise. Why would you run a vacuum with this option at all, if not to increase the table's relfrozenxid? But you can *not* advance relfrozenxid if you left old XIDs behind.) regards, tom lane