Re: PostgreSQL Portable

From: George Neuner <gneuner2(at)comcast(dot)net>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: PostgreSQL Portable
Date: 2014-09-12 13:34:09
Message-ID: u4s51ahdjhkaj9elpaumj74lj90leqoq1b@4ax.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi Craig,

On Fri, 12 Sep 2014 11:33:55 +0800, Craig Ringer
<craig(at)2ndquadrant(dot)com> wrote:

>On 09/11/2014 03:16 PM, George Neuner wrote:
>>
>> If the driver permits it and you [or your users] can be trusted to
>> perform a safe unmount via the OS *before* disconnecting the device,
>> then you can enable write caching for the device using the device
>> manager. [Note that the device must be connected for it to be visible
>> in the device manager.]
>
>It shouldn't be living dangerously, actually.
>
>While I haven't tested it myself, writeback caching on the external
>drive should be safe so long as it continues to honour explicit disk
>flush requests.
>
>That's why we have the WAL and do periodic checkpoints. If you yank the
>drive mid-write you'll lose uncommitted transactions and might have
>slower startup next time around, but it should otherwise not be overly
>problematic.

For the most part you're correct, but recall that WAL itself can be
made asynchronous [see fsync() and synchronous_commit() settings] and
the periodic OS sync also may be disabled - which doesn't affect WAL
handling but may(?) affect the background writer.

Even having synchronous WAL the most recent transactions can be lost
if the log device fails *during* a write. That's why, if we use
external devices at all, we tend to use closely coupled devices - disk
array, wired SAN, etc. - that aren't very likely to be physically
disconnected. And uninterruptible power all around 8-)

A portable device can be reasonably safe if treated properly, but it
never will be quite as safe as an internal device.

George

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Rémi Cura 2014-09-12 13:44:23 Re: PostgreSQL Portable
Previous Message Iain Mott 2014-09-12 09:27:52 Re: permission denied for schema topology