WARNING: could not flush dirty data: Function not implemented

Поиск
Список
Период
Сортировка
Искать

WARNING: could not flush dirty data: Function not implemented

От:
Ravi 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.



Re: WARNING: could not flush dirty data: Function not implemented

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Ravi Krishna  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Andres Freund <andres@anarazel.de>
Дата:
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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Ravi Krishna <sravikrishna@aol.com>
Дата:
> 
> 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.

Re: WARNING: could not flush dirty data: Function not implemented

От:
Andres Freund <andres@anarazel.de>
Дата:
Hi,

On 2018-09-02 19:29:49 -0400, Tom Lane wrote:
> Ravi Krishna  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Ravi Krishna <sravikrishna@aol.com>
Дата:
>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.

Re: WARNING: could not flush dirty data: Function not implemented

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Andres Freund  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Ravi Krishna <sravikrishna@aol.com>
Дата:
> 
> 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.

Re: WARNING: could not flush dirty data: Function not implemented

От:
Tom Lane <tgl@sss.pgh.pa.us>
Дата:
Ravi Krishna  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Dmitri Maziuk <dmaziuk@bmrb.wisc.edu>
Дата:
On Mon, 03 Sep 2018 09:58:57 -0400
Tom Lane  wrote:

> Ravi Krishna  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 

Re: WARNING: could not flush dirty data: Function not implemented

От:
Austin Drenski <austindrenski@gmail.com>
Дата:
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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Rob Sargent <robjsargent@gmail.com>
Дата:



On 09/03/2018 12:41 PM, Austin Drenski wrote:
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
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.

Re: WARNING: could not flush dirty data: Function not implemented

От:
Tim Cross <theophilusx@gmail.com>
Дата:

Tom Lane  writes:

> Andres Freund  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Tim Cross <theophilusx@gmail.com>
Дата:

Tom Lane  writes:

> Ravi Krishna  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

Re: WARNING: could not flush dirty data: Function not implemented

От:
Michael Paquier <michael@paquier.xyz>
Дата:
Вложения:
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
FAQ