Re: Understanding, testing and improving our Windows filesystem code

From: Thomas Munro <thomas(dot)munro(at)gmail(dot)com>
To: vignesh C <vignesh21(at)gmail(dot)com>
Cc: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>, Andres Freund <andres(at)anarazel(dot)de>
Subject: Re: Understanding, testing and improving our Windows filesystem code
Date: 2023-03-03 01:52:46
Message-ID: CA+hUKGJ4R=2oD6X=2+pvx-Qk54K6VT5uTq1ABUfpJ4SEDXuM-g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Jan 5, 2023 at 1:06 AM vignesh C <vignesh21(at)gmail(dot)com> wrote:
> On Tue, 25 Oct 2022 at 09:42, Thomas Munro <thomas(dot)munro(at)gmail(dot)com> wrote:
> > I pushed the bug fixes from this series, without their accompanying
> > tests. Here's a rebase of the test suite, with all those tests now
> > squashed into the main test patch, and also the
> > tell-Windows-to-be-more-like-Unix patch. Registered in the
> > commitfest.
>
> The patch does not apply ...

I think this exercise was (if I say so myself) quite useful, to
understand the Windows file system landscape. Maybe the things we
figured out by testing are common knowledge to real Windows
programmers, I dunno, but they were certainly all news to me and not
documented anywhere I could find, and the knowledge and tests will
probably help in future battles against Windows. The most important
things discovered were:

1. If you're testing on a Windows VM or laptop running 10 or 11 *you
aren't seeing the same behaviour as Windows Server*. So the semantics
don't match real production PostgreSQL deployments.

2. If we decided to turn on the new POSIX unlink semantics
explicitly as originally proposed by Victor, we'd get the behaviour we
really want on NTFS on all known Windows versions. But that would
move the traditional behaviour into a blind spot that we have no
testing for: ReFS and SMB. Our tree would probably gain more stuff
that doesn't work on them, so that would be tantamount to dropping
support.

Therefore, with regret, I'm going to withdraw this for now. We'd need
to get CI testing for ReFS and/or SMB first, which could be arranged,
but even then, what is the point of POSIX semantics if you don't have
them everywhere? You can't even remove any code! Unless we could
reach consensus that "PostgreSQL is not supported on SMB or ReFS until
they gain POSIX semantics" [which may never happen for all we know],
and then commit this patch and forget about non-POSIX unlink semantics
forever. I don't see us doing that in a hurry. So there's not much
hope for this idea in this commitfest.

The little C TAP framework could definitely be useful as a starting
point for something else, and the FS semantics test will definitely
come in handy if this topic is reopened by some of those potential
actions or needed to debug existing behaviour, and then I might even
re-propose parts of it, but it's all here in the archives anyway.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2023-03-03 02:10:47 Re: [PATCH] Use indexes on the subscriber when REPLICA IDENTITY is full on the publisher
Previous Message David Rowley 2023-03-03 01:52:22 Re: Making empty Bitmapsets always be NULL