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 1rXB2X-009AFg-Rl for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Feb 2024 02:18:26 +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 1rXB2W-00HCxe-O3 for pgsql-bugs@arkaria.postgresql.org; Tue, 06 Feb 2024 02:18:24 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXB2W-00HCxV-Fc for pgsql-bugs@lists.postgresql.org; Tue, 06 Feb 2024 02:18:24 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rXB2P-005Hbl-T8 for pgsql-bugs@postgresql.org; Tue, 06 Feb 2024 02:18:23 +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 4162IE02319902; Mon, 5 Feb 2024 21:18:14 -0500 From: Tom Lane To: Arnd Baranowski cc: pgsql-bugs@postgresql.org Subject: Re: PostgreSQL & latest Mac OS Sonoma, a possible bug / configuration issue In-reply-to: References: <269596.1707165898@sss.pgh.pa.us> Comments: In-reply-to Arnd Baranowski message dated "Mon, 05 Feb 2024 23:00:26 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-ID: <319900.1707185894.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Mon, 05 Feb 2024 21:18:14 -0500 Message-ID: <319901.1707185894@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Arnd Baranowski writes: > Correction fsync is =E2=80=9EOn" and the wal_sync_method is set to =E2=80= =9Eopen_datasync=E2=80=9C That's what they should be. I tried to reproduce this by selecting "Restart..." immediately after creating/populating a table on my own MacBook running Sonoma 14.3. After the reboot, the table was there with the expected contents. Now, this test doesn't actually prove a heck of a lot about PG's crash recovery, because I see in the postmaster log 2024-02-05 21:00:30.322 EST [1148] LOG: database system was shut down at = 2024-02-05 20:58:46 EST 2024-02-05 21:00:30.327 EST [1144] LOG: database system is ready to accep= t connections which indicates that Postgres had time to perform a clean shutdown before the system rebooted. (That is the expected scenario for an OS reboot, assuming that the kernel delivers us SIGTERM as it's required to do by POSIX and then gives us enough time to nail the windows shut, which it's not required to do.) The facts as you've presented them indicate that (1) checkpoints weren't working, (2) we didn't get SIGTERM at system shutdown, *and* (3) WAL wasn't written out to disk as it's supposed to be. It's a bit hard to credit that so many things are broken and nobody has noticed. I'm inclined to wonder if something is wrong with your disk drive. It would be interesting to know what appears in the first few lines of your postmaster log after a data-losing restart. Also, try running with log_checkpoints =3D on for awhile, and see if there are log entries claiming successful checkpoint completion. A different line of thought is that maybe the corruption is happening because you have two postmasters started in the same data directory. We have interlocks that are supposed to defend against that, but it'd be a lot easier to credit that those aren't working than that all the rest of this stuff broke. regards, tom lane