From: | John A Meinel <john(at)arbash-meinel(dot)com> |
---|---|
To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Postgresql Performance <pgsql-performance(at)postgresql(dot)org> |
Subject: | Re: PG8 Tuning |
Date: | 2005-08-16 23:14:41 |
Message-ID: | 43027361.2070303@arbash-meinel.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-performance |
Tom Lane wrote:
> John A Meinel <john(at)arbash-meinel(dot)com> writes:
>
>>Alvaro Herrera wrote:
>>
>>>I've been asked this a couple of times and I don't know the answer: what
>>>happens if you give XLog a single drive (unmirrored single spindle), and
>>>that drive dies? So the question really is, should you be giving two
>>>disks to XLog?
>
>
>>I can propose a simple test. Create a test database. Run postgres,
>>insert a bunch of stuff. Stop postgres. Delete everything in the pg_xlog
>>directory. Start postgres again, what does it do?
>
>
> That test would really be completely unrelated to the problem.
>
> If you are able to shut down the database cleanly, then you do not need
> pg_xlog anymore --- everything is on disk in the data area. You might
> have to use pg_resetxlog to get going again, but you won't lose anything
> by doing so.
So pg_xlog is really only needed for a dirty shutdown. So what about the
idea of having pg_xlog on a ramdisk that is syncronized periodically to
a real disk.
I'm guessing you would get corruption of the database, or at least you
don't know what is clean and what is dirty, since there would be no WAL
entry for some of the things that completed, but also no WAL entry for
things that were not completed.
So what is actually written to the WAL? Is it something like:
"I am writing these pages, and when page X has a certain value, I am
finished"
I'm just curious, because I don't believe you write to the WAL when you
complete the writing the data, you only make a note about what you are
going to do before you do it. So there needs to be a way to detect if
you actually finished (which would be in the actual data).
John
=:->
>
> The question of importance is: if the xlog drive dies while the database
> is running, are you going to be able to get the postmaster to shut down
> cleanly? My suspicion is "no" --- if the kernel is reporting write
> failures on WAL, that's going to prevent writes to the data drives (good
> ol' WAL-before-data rule). You could imagine failure modes where the
> drive is toast but isn't actually reporting any errors ... but one hopes
> that's not a common scenario.
>
> In a scenario like this, it might be interesting to have a shutdown mode
> that deliberately ignores writing to WAL and just does its best to get
> all the dirty pages down onto the data drives.
>
> In the meantime ... use a mirrored drive for WAL.
>
> regards, tom lane
>
From | Date | Subject | |
---|---|---|---|
Next Message | Anjan Dave | 2005-08-17 01:12:14 | Re: choosing RAID level for xlogs |
Previous Message | Tom Lane | 2005-08-16 22:49:59 | Re: PG8 Tuning |