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 1qo2nJ-00Cu1X-42 for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Oct 2023 14:24:09 +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 1qo2nH-00GBRy-1W for pgsql-bugs@arkaria.postgresql.org; Wed, 04 Oct 2023 14:24:07 +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 1qo2nG-00GBRq-P0 for pgsql-bugs@lists.postgresql.org; Wed, 04 Oct 2023 14:24:06 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qo2nE-0000aX-OL for pgsql-bugs@lists.postgresql.org; Wed, 04 Oct 2023 14:24:06 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 394EO1Fn2583427; Wed, 4 Oct 2023 10:24:01 -0400 From: Tom Lane To: Michael Paquier cc: Laurenz Albe , rootcause000@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #18146: Rows reappearing in Tables after Auto-Vacuum Failure in PostgreSQL on Windows In-reply-to: References: <18146-04e908c662113ad5@postgresql.org> <9fc4118d2a8f2290d8598a9c4d451c4c90b17cee.camel@cybertec.at> Comments: In-reply-to Michael Paquier message dated "Wed, 04 Oct 2023 16:24:45 +0900" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2583425.1696429441.1@sss.pgh.pa.us> Date: Wed, 04 Oct 2023 10:24:01 -0400 Message-ID: <2583426.1696429441@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Michael Paquier writes: > On Wed, Oct 04, 2023 at 09:17:11AM +0200, Laurenz Albe wrote: >> Data corruption like this is not necessarily caused by a PostgreSQL bug. > Err, well... A failure on the end-of-vacuum truncation should not > lead to corruption afterwards as well, and this ought to be safe even > if this step failed. This is a very tricky problem that nobody has > really looked into yet. ISTM we did identify the problem: while all the tuples in the pages-to-be-truncated should be dead and thus invisible, it may be that some of those pages are dirty and haven't been written out of shared buffers yet, and the page versions on disk contain tuples that look live. If VACUUM discards those dirty buffers and then fails to truncate, voila you have tuples rising from the dead. I'm too lazy to check the commit log right now, but I think we did implement a fix for that (ie, flush dirty pages even if we anticipate them going away due to truncation). But as Laurenz says, v10 is out of support and possibly didn't get that fix. Even if it did, you'd need to be running one of the last minor releases, because this wasn't very long ago. In the end though, the *real* problem here is running on a platform that randomly disallows writes to disk. There's only so much that Postgres can possibly do about unreliability of the underlying platform. I would never run a production database on Windows, because it's just too prone to that sort of BS. regards, tom lane