Re: BUG #16854: initdb fails on ReFS and FAT32 file systems - Mailing list pgsql-bugs

From Fujii Masao
Subject Re: BUG #16854: initdb fails on ReFS and FAT32 file systems
Date
Msg-id 59ad1f40-1bf2-a7e8-da22-7a279ea46efd@oss.nttdata.com
Whole thread Raw
In response to BUG #16854: initdb fails on ReFS and FAT32 file systems  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16854: initdb fails on ReFS and FAT32 file systems  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: BUG #16854: initdb fails on ReFS and FAT32 file systems  (Michael Paquier <michael@paquier.xyz>)
List pgsql-bugs

On 2021/02/05 13:55, PG Bug reporting form wrote:
> The following bug has been logged on the website:
> 
> Bug reference:      16854
> Logged by:          Katsuaki Fukushima
> Email address:      katsuaki.fukushima@gmail.com
> PostgreSQL version: 13.1
> Operating system:   Windows 10 Enterprise and Windows Server 2019
> Description:
> 
> In Microsoft Windows, initdb fails for ReFS and FAT32 file systems.
> PostgreSQL 12.x worked fine.
> The WAL allocated in the temporary is renamed to the canonical name with the
> durable_rename_excl function in src/backend/storage/file/fd.c.
> This function hardlinks to the canonical name and unlinks the temporary.
> Since ReFS does not support hard linking, the CreateHardLinkA function in
> src/port/link.c will fail and the OS will return error code 50.
> I replaced CreateHardLinka(dst, src, NULL) with MoveFileA(src, dst), and it
> works for now.
> I haven't investigated the effect on others.

This issue seems to be related to commit aaa3aeddee. That commit log says

     Previously, hard links were not used on Windows and Cygwin, but they
     support them just fine in currently supported OS versions, so we can
     use them there as well.
     
     Since all supported platforms now support hard links, we can remove
     the alternative code paths.

I'm not sure if ReFS is the supported platform or not. But if it is,
the assumption that the above commit log says is not correct. If so,
ISTM that we need to rethink the changes that commit introduced.

Regards,

-- 
Fujii Masao
Advanced Computing Technology Center
Research and Development Headquarters
NTT DATA CORPORATION



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #16855: No partition pruning when using partitions with custom hash function
Next
From: Tom Lane
Date:
Subject: Re: BUG #16854: initdb fails on ReFS and FAT32 file systems