A memory buffer backedup by a fd, shows undefined behavior if the fd is not resized appropriately. This shows up on file systems mounted on windows, the files end up with all bytes 0'ed.
Diff Detail
Diff Detail
Event Timeline
Comment Actions
What is the problem you are trying to fix? The current code is working fine for both non-Windows and Windows. This patch would make this function very slow on Windows.
Comment Actions
I was trying to debug a problem with the usage of FileOutputBuffer where the memory contents are not being synced to disk. I traced every call in FileOutputBuffer and none of the calls return an error, but the file is not synced. This happens on windows systems with FAST IO enabled. Resizing the underlying file makes the problem disappear.