Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2

From: Andres Freund <andres(at)anarazel(dot)de>
To: James Sewell <james(dot)sewell(at)jirotech(dot)com>
Cc: Thomas Munro <thomas(dot)munro(at)enterprisedb(dot)com>, Ravi Krishna <srkrishna(at)yahoo(dot)com>, "pgsql-generallists(dot)postgresql(dot)org" <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2
Date: 2019-02-19 01:06:22
Message-ID: 20190219010622.nhrhbzg6fzwzz5jb@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message James Sewell 2019-02-19 02:59:49 Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2
Previous Message James Sewell 2019-02-19 00:50:36 Re: WSL (windows subsystem on linux) users will need to turn fsync off as of 11.2