Hi, On 2019-02-19 11:50:36 +1100, James Sewell wrote: > > > > Right, the first step would be for a WSL user to figure out what's > > wrong with builds on the WSL and show us how to fix it; I heard > > through the grapevine that if you try it, initdb doesn't work (it must > > be something pretty subtle in the configure phase or something like > > that, since the Ubuntu .deb apparently works, except for the issue > > reported in this thread). > > > That's correct - initdb doesn't work when you've built on WSL as > *somehow* HAVE_FDATASYNC is set to 1 by configure - but it ends up not > being included by #ifdef blocks. This causes the following PANIC What do you mean by "not being included by #ifdef blocks"? The only guard in issue_xlog_fsync() is #ifdef HAVE_FDATASYNC, which ought to be independent of any includes? I can see how this'd go wrong if configure did *not* detect fdatasync, because then #if defined(PLATFORM_DEFAULT_SYNC_METHOD) #define DEFAULT_SYNC_METHOD PLATFORM_DEFAULT_SYNC_METHOD would trigger, which we explicitly set for linux: /* * Set the default wal_sync_method to fdatasync. With recent Linux versions, * xlogdefs.h's normal rules will prefer open_datasync, which (a) doesn't * perform better and (b) causes outright failures on ext4 data=journal * filesystems, because those don't support O_DIRECT. */ #define PLATFORM_DEFAULT_SYNC_METHOD SYNC_METHOD_FDATASYNC Greetings, Andres Freund