Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ja0rZ-0008Jg-J4 for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 17:44:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1ja0rY-00035b-4V for pgsql-general@arkaria.postgresql.org; Sat, 16 May 2020 17:44:40 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ja0rX-00035T-Si for pgsql-general@lists.postgresql.org; Sat, 16 May 2020 17:44:39 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1ja0rU-0003Hw-Ua for pgsql-general@postgresql.org; Sat, 16 May 2020 17:44:39 +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 04GHiYCp028984; Sat, 16 May 2020 13:44:34 -0400 From: Tom Lane To: Don Seiler cc: Postgres General Subject: Re: template0 needing vacuum freeze? In-reply-to: References: Comments: In-reply-to Don Seiler message dated "Sat, 16 May 2020 12:19:13 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <28982.1589651074.1@sss.pgh.pa.us> Date: Sat, 16 May 2020 13:44:34 -0400 Message-ID: <28983.1589651074@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk Don Seiler writes: > PG 9.6 (9.6.8). Got an alert today when template0 and template1 were both > over 50% towards TXID wraparound. I could vacuum template1 but couldn't > vacuum template0 without first allowing connections. This is what it looked > like before: template0 shouldn't really need freezing, if it's unchanged since initdb, but the autovacuum logic doesn't know that and will periodically scan it anyway. That should be pretty cheap (since that DB is small and there's not really any work to do), so we haven't considered it to be something to prevent --- especially since it is a good safety valve in case someone does change template0. So it's unsurprising that the freeze age increases until autovacuum decides to do something about it. I'm suspicious that your alert settings are too aggressive and are notifying you before autovacuum kicks in. You should *not* have had to do anything manual about this, unless you have frobbed your autovac settings to the point of brokenness. regards, tom lane