WARNING: could not flush dirty data: Function not implemented

Started by Ravi Krishnaover 7 years ago15 messagesgeneral
Jump to latest
#1Ravi Krishna
sravikrishna@aol.com

Ubuntu 18.04 as Windows bash

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

PG 10.5.1

postgres@ravi-lenovo:~$ psql -d postgres
psql (10.5 (Ubuntu 10.5-1.pgdg16.04+1))

A CREATE DATABASE statement spewed out

WARNING: could not flush dirty data: Function not implemented

many times, but the db was created.

What exactly is this?

A simple search tells that this is an old problem and my Windows has necessary WSL and other subsystem for this error to not show up.

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ravi Krishna (#1)
Re: WARNING: could not flush dirty data: Function not implemented

Ravi Krishna <sravikrishna@aol.com> writes:

A CREATE DATABASE statement spewed out
WARNING: could not flush dirty data: Function not implemented

Hmm, that's probably ENOSYS coming back from sync_file_range().
What filesystem is this database sitting on?

It's harmless from a correctness standpoint, because we'll fsync
the data later anyway; but it seems bad that we've selected
sync_file_range() if it doesn't actually work on your platform.

A simple search tells that this is an old problem and my Windows has necessary WSL and other subsystem for this error to not show up.

If this is on Ubuntu, I don't understand why you're talking
about Windows.

regards, tom lane

#3Andres Freund
andres@anarazel.de
In reply to: Ravi Krishna (#1)
Re: WARNING: could not flush dirty data: Function not implemented

Hi,

On 2018-09-02 22:57:55 +0000, Ravi Krishna wrote:

Ubuntu 18.04 as Windows bash

Distributor ID: Ubuntu
Description: Ubuntu 18.04.1 LTS
Release: 18.04
Codename: bionic

PG 10.5.1

postgres@ravi-lenovo:~$ psql -d postgres
psql (10.5 (Ubuntu 10.5-1.pgdg16.04+1))

A CREATE DATABASE statement spewed out

WARNING: could not flush dirty data: Function not implemented

many times, but the db was created.

What exactly is this?

That means that the linux emulation by microsoft isn't good enough. You
can work around it by setting checkpoint_flush_after=0 and
wal_writer_flush_after=0.

A simple search tells that this is an old problem and my Windows has
necessary WSL and other subsystem for this error to not show up.

Please note that nobody has verified that postgres works correctly via
the emulation stuff MS is doing. There is a native version of postgres
for windows however, and that is tested (and exercised by a lot of
installations).

Greetings,

Andres Freund

#4Ravi Krishna
sravikrishna@aol.com
In reply to: Tom Lane (#2)
Re: WARNING: could not flush dirty data: Function not implemented

If this is on Ubuntu, I don't understand why you're talking
about Windows.

Because I am using Ubuntu Bash on Windows, which requires WLS (Windows Linux Subsystem). I also have necessary build version of Windows which supports Ubuntu Bash.

#5Andres Freund
andres@anarazel.de
In reply to: Tom Lane (#2)
Re: WARNING: could not flush dirty data: Function not implemented

Hi,

On 2018-09-02 19:29:49 -0400, Tom Lane wrote:

Ravi Krishna <sravikrishna@aol.com> writes:

A simple search tells that this is an old problem and my Windows has necessary WSL and other subsystem for this error to not show up.

If this is on Ubuntu, I don't understand why you're talking
about Windows.

The OP said "Ubuntu 18.04 as Windows bash" - so I assume this is
postgres compiled as a linux binary is running on MS's new-ish linux
emulation.

Greetings,

Andres Freund

#6Ravi Krishna
sravikrishna@aol.com
In reply to: Andres Freund (#5)
Re: WARNING: could not flush dirty data: Function not implemented

That means that the linux emulation by microsoft isn't good enough. You
can work around it by setting checkpoint_flush_after=0 and
wal_writer_flush_after=0.

bgwriter_flush_after = 0 # measured in pages, 0 disables
backend_flush_after = 0 # measured in pages, 0 disables
wal_writer_flush_after = 0 # measured in pages, 0 disables
checkpoint_flush_after = 0 # measured in pages, 0 disables

I set it as shown above and yet while create the database I get the same warning.

#7Tom Lane
tgl@sss.pgh.pa.us
In reply to: Andres Freund (#5)
Re: WARNING: could not flush dirty data: Function not implemented

Andres Freund <andres@anarazel.de> writes:

On 2018-09-02 19:29:49 -0400, Tom Lane wrote:

If this is on Ubuntu, I don't understand why you're talking
about Windows.

The OP said "Ubuntu 18.04 as Windows bash" - so I assume this is
postgres compiled as a linux binary is running on MS's new-ish linux
emulation.

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

regards, tom lane

#8Ravi Krishna
sravikrishna@aol.com
In reply to: Tom Lane (#7)
Re: WARNING: could not flush dirty data: Function not implemented

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to Linux stack then ... gasp Windows :-)

Anyhow so far I am seeing this warning only for create database command. So I can ignore.

#9Tom Lane
tgl@sss.pgh.pa.us
In reply to: Ravi Krishna (#8)
Re: WARNING: could not flush dirty data: Function not implemented

Ravi Krishna <sravikrishna@aol.com> writes:

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to Linux stack then ... gasp Windows :-)

Hmm, so maybe you should install Ubuntu as the native O/S, and when
you need Windows, run it inside a VM?

regards, tom lane

#10Dimitri Maziuk
dmaziuk@bmrb.wisc.edu
In reply to: Tom Lane (#9)
Re: WARNING: could not flush dirty data: Function not implemented

On Mon, 03 Sep 2018 09:58:57 -0400
Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ravi Krishna <sravikrishna@aol.com> writes:

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to Linux stack then ... gasp Windows :-)

Hmm, so maybe you should install Ubuntu as the native O/S, and when
you need Windows, run it inside a VM?

Between windows 10 and ubuntu 18.04, I would take a really close look at freebsd myself. Or at least alpine...

--
Dmitri Maziuk <dmaziuk@bmrb.wisc.edu>

#11Austin Drenski
austindrenski@gmail.com
In reply to: Dimitri Maziuk (#10)
Re: WARNING: could not flush dirty data: Function not implemented

Dmitri Maziuk <dmaziuk@bmrb.wisc.edu> wrote:

Tom Lane <tgl@sss.pgh.pa.us> wrote:

Ravi Krishna <sravikrishna@aol.com> writes:

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to Linux

stack then ... gasp Windows :-)

Hmm, so maybe you should install Ubuntu as the native O/S, and when
you need Windows, run it inside a VM?

Between windows 10 and ubuntu 18.04, I would take a really close look at

freebsd myself. Or at least alpine...

As a developer, I regularly work with PostgreSQL in the Windows Subsystem
for Linux (WSL). In using it for sandboxing and testing, the only notable
idiosyncrasy that I have encountered is the appearance of these warnings on
startup.

Unfortunately, workstation OS is not always a choice, but WSL has so far
offered a productive (and built-in!) option for running Linux-based tools
on Windows.

I can't imagine running a production server from WSL, but it is a
refreshingly simple way to spin up local dev databases. It would be great
to see the community take an interest in supporting PostgreSQL in WSL, if
only in the context of its use as a development tool.

--
Austin Drenski

#12Rob Sargent
robjsargent@gmail.com
In reply to: Austin Drenski (#11)
Re: WARNING: could not flush dirty data: Function not implemented

On 09/03/2018 12:41 PM, Austin Drenski wrote:

Dmitri Maziuk <dmaziuk@bmrb.wisc.edu <mailto:dmaziuk@bmrb.wisc.edu>>
wrote:

Tom Lane <tgl@sss.pgh.pa.us <mailto:tgl@sss.pgh.pa.us>> wrote:

Ravi Krishna <sravikrishna@aol.com <mailto:sravikrishna@aol.com>> writes:

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one.  I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to

Linux stack then ... gasp Windows :-)

Hmm, so maybe you should install Ubuntu as the native O/S, and when
you need Windows, run it inside a VM?

Between windows 10 and ubuntu 18.04, I would take a really close look at

freebsd myself. Or at least alpine...

As a developer, I regularly work with PostgreSQL in the Windows
Subsystem for Linux (WSL). In using it for sandboxing and testing, the
only notable idiosyncrasy that I have encountered is the appearance of
these warnings on startup.

Unfortunately, workstation OS is not always a choice, but WSL has so
far offered a productive (and built-in!) option for running
Linux-based tools on Windows.

I can't imagine running a production server from WSL, but it is a
refreshingly simple way to spin up local dev databases. It would be
great to see the community take an interest in supporting PostgreSQL
in WSL, if only in the context of its use as a development tool.

--
Austin Drenski

I lost here.   If you're forced to run windows as the principle OS run
windows-based postgres.  If you wish to use the ubuntu as a dev
environment can you not connect from there to the native Postgres instance.

#13Tim Cross
theophilusx@gmail.com
In reply to: Tom Lane (#7)
Re: WARNING: could not flush dirty data: Function not implemented

Tom Lane <tgl@sss.pgh.pa.us> writes:

Andres Freund <andres@anarazel.de> writes:

On 2018-09-02 19:29:49 -0400, Tom Lane wrote:

If this is on Ubuntu, I don't understand why you're talking
about Windows.

The OP said "Ubuntu 18.04 as Windows bash" - so I assume this is
postgres compiled as a linux binary is running on MS's new-ish linux
emulation.

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one.

That comment has made my day - thanks Tom!

--
Tim Cross

#14Tim Cross
theophilusx@gmail.com
In reply to: Tom Lane (#9)
Re: WARNING: could not flush dirty data: Function not implemented

Tom Lane <tgl@sss.pgh.pa.us> writes:

Ravi Krishna <sravikrishna@aol.com> writes:

Whee ... so you get to cope with all the bugs/idiosyncrasies of three
operating system layers, not just one. I concur that running Postgres
in the underlying Windows O/S is probably a much better idea.

Me too, but this is purely for learning and I am much more use to Linux stack then ... gasp Windows :-)

Hmm, so maybe you should install Ubuntu as the native O/S, and when
you need Windows, run it inside a VM?

regards, tom lane

This is what I do and it works well except.....

If you don't run the windows VM very often (like me), when you do, start
it before lunch or that next long meeting. The updates will grind things
to a crawl. When you run every day or fairly frequently, you don't
notice them, but if you only run once every 4+ weeks, it can have a big
impact and take ages.

Linux as the host and using the VM is still better than the weird
idiosyncrasies of Windows as the main workstation client (IMO). Where
office policy has insisted on Windows as the workstation, I have had
reasonable success with running virtualbox with Linux, though these
days, the Windows environment is often too locked down to allow
this. I've not yet experimented with the virtual linux layer in w10.

--
Tim Cross

#15Michael Paquier
michael@paquier.xyz
In reply to: Andres Freund (#3)
Re: WARNING: could not flush dirty data: Function not implemented

On Sun, Sep 02, 2018 at 04:31:18PM -0700, Andres Freund wrote:

Please note that nobody has verified that postgres works correctly via
the emulation stuff MS is doing. There is a native version of postgres
for windows however, and that is tested (and exercised by a lot of
installations).

If there are folks willing to put enough effort in getting this to work,
it could work, assuming that a buildfarm animal is able to get down this
road. From what I can see on this thread we are not yet at that stage
though.
--
Michael