Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uxF0N-00CLDy-EO for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Sep 2025 01:24:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uxF0L-004nPe-8o for pgsql-bugs@arkaria.postgresql.org; Sat, 13 Sep 2025 01:24:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uxF0K-004nPQ-Vb for pgsql-bugs@lists.postgresql.org; Sat, 13 Sep 2025 01:24:41 +0000 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uxF0H-000W0p-2I for pgsql-bugs@lists.postgresql.org; Sat, 13 Sep 2025 01:24:41 +0000 Received: by mail-wm1-x332.google.com with SMTP id 5b1f17b1804b1-45cb6428c46so29508155e9.1 for ; Fri, 12 Sep 2025 18:24:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cybertec.at; s=google; t=1757726678; x=1758331478; darn=lists.postgresql.org; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:from:to:cc:subject :date:message-id:reply-to; bh=pQFI5tv2oN9RfR7yGNtGpAc2qYQ7Aqe384oWTmTo4KA=; b=m1R3ALMe6EaXoEznqQLPURSDGB00Kmcmzfd3gQKonBDsJGApP116AnI60Fv8ZA1Ywz 9pwvL4qigMEyZlOSTAERkTCNrRoWYW4GnLgrZDhUdtw6jFEg7CSItIpotxiJQbYhbBl9 9kntrG0Zd5ja6YORLKnYf2nx7uIsaVj+R+KVH6+5S7eSAWeHTRCJoJdoYmOXj6GKmOvf qeRm2ewgPrbJENmNa4swnR1twq1WYLDe/r0LgzZK1HKm28JO/lUBoj7mL9L4NZdvWDjz jkRTqKacWpuB1RzSoxdk28poxy+DmyDLAxYEBVG/chEJps2lafQ30UsDP4NLOeuC7UOD vr3Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757726678; x=1758331478; h=mime-version:user-agent:content-transfer-encoding:references :in-reply-to:date:cc:to:from:subject:message-id:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=pQFI5tv2oN9RfR7yGNtGpAc2qYQ7Aqe384oWTmTo4KA=; b=iGPBm02rL3royNWqjO9p8pP04zteKQlDQ29+SKbmmU1SCcZXMqw9/QAsDrZ4R4sMCa 5q2UDKW+9WaSRc06JOaII5GH50PDVVJQXTfztqhe86oK02sbSw+SIAP4xSCF+ecLJcUZ y+SYB2aYcV7U2V5Z1uf5Nff8DsAQQTfYCx+tImJ0mngqSzpxzpBCXuvc/CVa3EFFIt5j IUCu945tef9dBx+mxpeThPtdhDScy0+gtx0u3JkACqVciNJrAqyKtKjJdA//v6NNJw4p 3ABz8KSgmL2fPzRU9YS1R7gKBF37Kuf2cXRU0pm0vO8TKODXX4zoqZOxzrODRgvK8uLa xIwQ== X-Gm-Message-State: AOJu0Ywh5xDR+UOwoGv6XIbBuSsQlsChHQeRM2OTtnUZcciYcXoj1P59 W1cPlZkmhIC/JSAyE9hqmeFZKg3jknLoJ6VgykYryQVHZx4PmlVTokQlWKr93VYpXkQ= X-Gm-Gg: ASbGncta+mFgydLwBaBWMWHMHYAZXzFr9W/MSfON25TrmdnrPPjrnL8opGOoloJMI0n 8YX0noCqQ+oWKd0ZhW3aDGCiKDqSw2Sjn6uzbtvc4k+ROnTv7db/GI4HTCJaFNIteQWYqvsW9K7 qmr/6I/H/znheEeZkotGKWjyoaExO+rd3ZcvfdKK84m0t1BG2zfTk9B0OvBP/HcWTOT1p22KUKh RdjMAHIyw4w36TkbhtNQh/xqcCeaFSOwxF1yg5zQP/FZcbevDGUpXhcthKHf9zPExJ7z0uDre0Y tsen7swqRPwZpcKQ6WRVEK/nSh5FiJWuT3IXqmxfWMGimoT1GNxthNp3QJEUPTSF6DNp81vbgVp SzatLpu4cgZIJFj2hbei4dDDz4UaRCFZRXVgUQJBqosW0fNwIc6+qzkLIB5MO/ik= X-Google-Smtp-Source: AGHT+IF0h8wFLfuH4NJ3wJoFIPTM1G+26gZdniMRDiEI/y58Lt6crDQtIJIQnYyy070VmTarnZM7SA== X-Received: by 2002:a05:600c:1d2a:b0:45b:9c93:d21d with SMTP id 5b1f17b1804b1-45f24ef20d0mr33376565e9.8.1757726677964; Fri, 12 Sep 2025 18:24:37 -0700 (PDT) Received: from laurenz.albe-K4N0CV00F97414D ([2001:871:255:30a:2403:9037:2d08:c2c]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-3e7607870c4sm8377927f8f.22.2025.09.12.18.24.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Sep 2025 18:24:37 -0700 (PDT) Message-ID: Subject: Re: ERROR: found xmin 4133102167 from before relfrozenxid 4151440783 From: Laurenz Albe To: Tushar Takate Cc: pgsql-bugs@lists.postgresql.org Date: Sat, 13 Sep 2025 03:24:37 +0200 In-Reply-To: References: <1d7c9fc27e3a304b1f4ba225afdfca9c3b3fb536.camel@cybertec.at> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.56.2 (3.56.2-2.fc42) MIME-Version: 1.0 List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Sat, 2025-09-13 at 06:40 +0530, Tushar Takate wrote: > On Sat, Sep 13, 2025 at 2:40=E2=80=AFAM Laurenz Albe wrote: > > On Fri, 2025-09-12 at 22:09 +0530, Tushar Takate wrote: > > > PostgreSQL version: 15.12 > > > Disk type: RAID5 > > > OS: RHEL 8.10 > > >=20 > > > Error/Issue :=20 > > >=20 > > > vacuumdb: error: processing of database "live_order_us_db" failed: ER= ROR: =C2=A0found xmin 4133102167 from before relfrozenxid 4151440783 > > >=20 > > > 2025-09-11 02:29:58.888 UTC,,,2362287,,68c233e1.240hbf,1,,2025-09-11 = 02:28:49 UTC,122/46371006,0,ERROR,XX001,"found xmin 4133102167 from before = relfrozenxid 4151440783",,,,,"while scanning block 5821149 offset 5 of rela= tion ""public.order"" > > > 2025-09-11 02:40:50.361 UTC,"prod_user_ap","live_order_us_db",2375672= ,"127.0.0.1:59344",68c2342b.243ff8,4,"VACUUM",2025-09-11 02:30:03 UTC,169/3= 8875732,0,ERROR,XX001,"found xmin 4133102167 from before relfrozenxid 41514= 40783",,,,,"while scanning block 5821149 offset 5 of relation ""public.orde= r""","VACUUM (VERBOSE, ANALYZE) public.order;",,,"vacuumdb","client backend= ",,-5528190995457849841 > >=20 > > That is probably caused by a PostgreSQL bug; you can get rid of the mes= sage >=20 > In which version can we expect the fix for it? Also, can you please help = to understand > which specific condition or scenario is triggering this PostgreSQL error = and=C2=A0skipping > to freeze=C2=A0xmin? I *believe* there must be a bug that causes that problem, because I have se= en that error reported often enough that I don't think it can be attributed to hardware e= rrors. Unfortunately, I think that nobody knows how it happens, so we cannot fix i= t. > > by creating the "pg_surgery" extension and running > >=20 > > =C2=A0 SELECT heap_force_freeze('public.order'::regclass, '{(5821149,5)= }'::tid[]); >=20 > I agree we can run=C2=A0pg_surgery=C2=A0, but the question is how safe it= is to run for large and mission-critical tables over 200GB. > From=C2=A0pg_surgery doc:=C2=A0These functions are unsafe by design and u= sing them may corrupt (or further corrupt) your database It is dangerous, and that has nothing to do with the size of the table. If you do the wrong thing with that knife, you can cause more problems than you fix. > > > One more thing/observation we saw in the PostgreSQL logs : > > >=20 > > > The following message consistently appeared once a day during the pas= t week > > >=20 > > > 2025-09-10 23:33:14.469 UTC,,,157915,,68c21a46.268fb,3,,2025-09-10 23= :31:18 UTC,45/49119328,0,WARNING,01000,"page is not marked all-visible but = visibility map bit is set in relation ""order"" page 5815453",,,,,"while sc= anning block 5815453 of relation ""public.order""",,,,"","autovacuum worker= ",,0 > > >=20 > > > What specific condition or scenario is triggering this PostgreSQL err= or?=C2=A0Can it be classified > > > as a bug? If not, what=E2=80=99s a safe and=C2=A0efficient=C2=A0way t= o resolve it without relying on a dump > > > and restore, particularly for large, mission-critical tables over 200= GB? > >=20 > > That is some kind of data corruption, perhaps caused by a bug, perhaps = by > > something else.=C2=A0 The autovacuum run should fix that problem. >=20 > This is something supporting data I have provided, before the issue, the = above WARNING was seen in db-logs for the same table.=C2=A0 Sorry, I cannot parse that sentence. Yours, Laurenz Albe