Re: PostgreSQL still for Linux only? - Mailing list pgsql-general

From Magnus Hagander
Subject Re: PostgreSQL still for Linux only?
Date
Msg-id 6BCB9D8A16AC4241919521715F4D8BCE476AC6@algol.sollentuna.se
Whole thread Raw
In response to PostgreSQL still for Linux only?  (Tope Akinniyi <topeakinniyi@yahoo.co.uk>)
Responses Re: PostgreSQL still for Linux only?
List pgsql-general
> > Do *not* do this with a production database.
> >
> > Vmware does *not* correctly handle fsync()s (or O_SYNC or any of
> > those) thruogh to disk. If your host PC crashes, your database will
> > almost certainly be corrupted. fsync() on the client just
> puts it in
> > the RAM cache on the host. Not even in the write cache on
> the disk/raid.
>
> Putting Windows NT inside a virtual machine (VMware
> workstation) solved all hardware stability problems in my
> case. NT would only crash if we forgot to reboot every 45
> days or so... The Linux host had a 9 month uptime at one point.
>
> If you could be more explicit as to why VMware client does
> not write to disk I would much appreciate. I was thinking of
> virtualising a couple of servers (Linux client on Linux host). TIA

PostgreSQL relies on fsync() putting your data all the way through to
the disc. It must *not* stay in cache memory, because then you can lose
transactions. If write ordering is also lost (which is likely in this
case), you can get a corrupt database.

In the tests I've been running on vmware, a fsync() in the guest OS will
flush it out of the guest OSs buffer, but the data will stay in the host
OS buffers.

This means that you may be hosed if your host OS crashes. It should
survive a *guest* OS crash without problems.

I haven't had any actual crashes on this, but there is plenty of
evidence that syncing doesn't go all the way through (see my other mail)
at least with Windows as the host OS. Which means you are basically
running with write-cache enabled all the time with no way to turn it
off, and some reading of the pg lists should tell you how bad that is.

It's possible this works fine if you use direct disk access in vmware
(giving the session a native disk to access), but I haven't tried that.


After some looking around (and with some hints from Dave Page) for my
own needs of virtualising linux-on-linux, I've moved to linux-vservers.
While it doesn't virtualise everything, it's good enough for me. I
suggest you at least look at it before going down the vmware path - it's
also free software unlike vmware.

//Magnus

pgsql-general by date:

Previous
From: Kevin Murphy
Date:
Subject: Mac OS X 10.3 and SYSV shared memory settings
Next
From: William Shatner
Date:
Subject: