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 1m41cH-00020m-L1 for pgsql-general@arkaria.postgresql.org; Thu, 15 Jul 2021 13:41:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m41cG-0001Lz-0v for pgsql-general@arkaria.postgresql.org; Thu, 15 Jul 2021 13:41:28 +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 1m41cF-0001Lr-O4 for pgsql-general@lists.postgresql.org; Thu, 15 Jul 2021 13:41:27 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m41cD-0005er-0n for pgsql-general@postgresql.org; Thu, 15 Jul 2021 13:41:27 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id EC9673200917; Thu, 15 Jul 2021 09:41:22 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Thu, 15 Jul 2021 09:41:23 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm3; bh=ZaZK5TlL1u1G/GT7vgWmp1FAS7RHZm/mHv7GKrpTwPo=; b=DaWndrJQ ceW1lWVzjsbPa1nPdzrAbRqEIqEhABWXTsTCyXNXcn1jkFadZXAPOReTvhcedEiB NSQbDZqWPzY5XkMjZVBfGPtzP0bFpxNMsQ8wXE3ZCFiowp9irVdI8ogKNhDw6eca YUBD43Q+tSz6aVEx89BOWwcrV8RJX1c28RzfpOD28DEGdaWgO9TT9Mn7VyyklDsG UoAexDv6DisG+nsUUNb6nOoDFYE7mmakcma0TgPr1GQLT25O2Hx+4JPquFrjS2l9 Gy4mvht4rdV58ilxgm4geSBpagYC4xNZHNObN7kOz3Z6kc9drZUPzUQYGINju51K weSr0Ag+lAdTeQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtgdegkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepfffhvffukfggtggugfgjsehtkeertd dttdejnecuhfhrohhmpeetlhhvrghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvges rghlvhhhrdhnohdqihhprdhorhhgqeenucggtffrrghtthgvrhhnpeejjeevffeukeejie ekheehleduudehteeiudegteetkefhveelhfefvdduvdfgfeenucffohhmrghinhepphho shhtghhrrdgvshdpvghnthgvrhhprhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuih iivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdr nhhoqdhiphdrohhrgh X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 15 Jul 2021 09:41:22 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id F37452A099B; Thu, 15 Jul 2021 09:41:18 -0400 (-04) Date: Thu, 15 Jul 2021 09:41:18 -0400 From: Alvaro Herrera To: Sasha Aliashkevich Cc: pgsql-general@postgresql.org Subject: Re: ERROR: cannot freeze committed xmax Message-ID: <202107151341.z63mfqvq3vrs@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <202107151336.g55vi6aj7e7m@alvherre.pgsql> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk One thing I forgot is that these XIDs are fairly old, perhaps dating back to when this database was freshly initdb'd if there has been no XID wraparound. In that case you were probably running a version much older than 10.14 when they were written. Do you happen to know when did you initdb this, with what version, when did you upgrade this to 10.14? That may help search the commit log for bugfixes that might explain the bug. I just remembered this one as my favorite candidate: Author: Alvaro Herrera Branch: master Release: REL_11_BR [d2599ecfc] 2018-05-04 18:24:45 -0300 Branch: REL_10_STABLE Release: REL_10_4 [e1d634758] 2018-05-04 18:23:58 -0300 Branch: REL9_6_STABLE Release: REL9_6_9 [3a11485a5] 2018-05-04 18:23:30 -0300 Don't mark pages all-visible spuriously Dan Wood diagnosed a long-standing problem that pages containing tuples that are locked by multixacts containing live lockers may spuriously end up as candidates for getting their all-visible flag set. This has the long-term effect that multixacts remain unfrozen; this may previously pass undetected, but since commit XYZ it would be reported as "ERROR: found multixact 134100944 from before relminmxid 192042633" because when a later vacuum tries to freeze the page it detects that a multixact that should have gotten frozen, wasn't. Dan proposed a (correct) patch that simply sets a variable to its correct value, after a bogus initialization. But, per discussion, it seems better coding to avoid the bogus initializations altogether, since they could give rise to more bugs later. Therefore this fix rewrites the logic a little bit to avoid depending on the bogus initializations. This bug was part of a family introduced in 9.6 by commit a892234f830e; later, commit 38e9f90a227d fixed most of them, but this one was unnoticed. Authors: Dan Wood, Pavan Deolasee, Álvaro Herrera Reviewed-by: Masahiko Sawada, Pavan Deolasee, Álvaro Herrera Discussion: https://postgr.es/m/84EBAC55-F06D-4FBE-A3F3-8BDA093CE3E3@amazon.com -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "El número de instalaciones de UNIX se ha elevado a 10, y se espera que este número aumente" (UPM, 1972)