Hello Michael, 06.07.2021 11:33, Michael Paquier wrote: > On Sun, Mar 14, 2021 at 06:00:00PM +0300, Alexander Lakhin wrote: >> I believe that the patch attached to [1] should fix this issue. The >> patch still applies to master and makes the demotest (attached to [2]) >> pass. Also I've prepared a trivial patch that makes pgwin32_open() use >> the original stat() function (as in the proposed change for _pgstat64()). > Hmm. Knowing that _pgfstat64() has some special handling related to > files pending for deletion, do we really need that on HEAD? Yes, this fix is needed for HEAD (b9734c13) as the simple test attached to [1] shows: (You can put that script in src\test\modules\test_misc\t and perform `vcregress taptest src\test\modules\test_misc`.) t/001_delete_pending.pl ......... # Looks like your test exited with 2 before it could output anything.
and src\test\modules\test_misc\tmp_check\log\regress_log_001_delete_pending contains: # Postmaster PID for node "node" is 1616 error running SQL: 'psql:<stdin>:1: ERROR: could not stat file "pg_wal/dummy": Permission denied' while running 'psql -XAtq -d port=64889 host=127.0.0.1 dbname='postgres' -f - -v ON_ERROR_STOP=1' with sql 'select count(*) > 0 as ok from pg_ls_waldir();' at C:/src/postgresql/src/test/perl/PostgresNode.pm line 1771. As Tom Lane noted above, the code added with bed90759f is dubious (_NtQueryInformationFile() can not be used to handle the "delete pending" state as CreateFile() returns INVALID_HANDLE_VALUE in this case.) Probably that change should be reverted. Should I do it along with the proposed fix? [1] https://www.postgresql.org/message-id/c3427edf-d7c0-ff57-90f6-b5de3bb62709%40gmail.com Best regards, Alexander