Affects Version/s: 1.12.x
Fix Version/s: None
Windows Server 2019 Standard
Windows Failover Cluster
Cluster Shared Volume on top of NTFS
svnadmin reproducibly fails to initialize an empty repository on a cluster shared volume in a Windows Failover Cluster environment on Windows Server 2019. The initial call seems to be successful.
Further investigation revealed that the L2P index never gets written to the revision file. I have attached the relevant file of revision 0.
Index data seems to be appended to the revision file in subversion/libsvn_fs_fs/transaction.c by a call to svn_fs_fs__add_index_data:
svn_io_file_seek queries file metadata to acquire the required offset to write the next chunk of data. However, both calls yield an identical offset equal to the initial length of the revision file. Thus, the L2P index is overwritten by writing the P2L index data. I was able to confirm this by monitoring svnadmin using Procmon (see attached Procmon.csv) on both local and cluster shared volumes. I strongly suspect that file metadata is not flushed to the disk fast enough before the second call to svn_io_file_seek. As far as i recall (in the case of Windows), filesystem metadata is always cached. To ensure storage of metadata to disk, the file must either be flushed or be opened with FILE_FLAG_WRITE_THROUGH.