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 1tUoQI-002wsD-6d for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 14:49:42 +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 1tUoQH-009Qcy-HF for pgsql-hackers@arkaria.postgresql.org; Mon, 06 Jan 2025 14:49:41 +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 1tUoQH-009Qcp-7U for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 14:49:40 +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.96) (envelope-from ) id 1tUoQE-000ALs-27 for pgsql-hackers@lists.postgresql.org; Mon, 06 Jan 2025 14:49:39 +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 506EnMmr1299369; Mon, 6 Jan 2025 09:49:22 -0500 From: Tom Lane To: Robert Haas cc: Thomas Munro , Peter Eisentraut , Larry Rosenman , Pgsql hackers Subject: Re: Fwd: Re: A new look at old NFS readdir() problems? In-reply-to: References: <04cf05d053e9320012b32370e228fac4@lerctr.org> <302248.1735850933@sss.pgh.pa.us> <309402.1735854754@sss.pgh.pa.us> <319417.1735860015@sss.pgh.pa.us> <338175.1735869481@sss.pgh.pa.us> <469548.1735927963@sss.pgh.pa.us> <520100.1735952472@sss.pgh.pa.us> <572149.1735978551@sss.pgh.pa.us> Comments: In-reply-to Robert Haas message dated "Mon, 06 Jan 2025 09:20:18 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1299367.1736174962.1@sss.pgh.pa.us> Date: Mon, 06 Jan 2025 09:49:22 -0500 Message-ID: <1299368.1736174962@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Robert Haas writes: > Yeah, that seems like very strong evidence against FreeBSD, but I > think Thomas Munro's point about CIFS is worth considering. That is > rather widely used, and if the same workarounds would help both that > and FreeBSD's NFS, we might want to adopt it even if it's not a > complete fix. TBH, I am happy that PG is now failing in a fairly visible way on filesystems that are broken in this fashion. I think that is better than silent data corruption in obscure circumstances, which is where we were before and would be again if we band-aid rmtree() and do nothing else. Nor do I think it's worth the effort to try to become fully bulletproof on the point. I think we should document that CIFS is unsupported. The docs could say something like: Storing databases on filesystems with unreliable readdir() is not supported and can lead to data corruption. If you observe warnings like "directory is not empty" when trying to drop a database, that is strong evidence that the filesystem has unreliable readdir(). Filesystems known to have this problem include NFS on FreeBSD and CIFS on all platforms. We could s/FreeBSD/older FreeBSD/ if something comes of Thomas' efforts to fix that situation. regards, tom lane