pg.ddx.io  pgsql-performance@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Aidan Van Dyk <aidan@highrise.ca>
To: pgsql-performance@postgresql.org
Subject: Re: Create and drop temp table in 8.3.4
Date: Tue, 11 Nov 2008 10:07:53 -0500
Message-ID: <20081111150753.GA31053@yugib.highrise.ca> (raw)
In-Reply-To: <20081107031921.GE15954@yugib.highrise.ca>
References: <1225999071.1204.14.camel@jd-laptop.pragmaticzealot.org>
	<4912F29E.EE98.0025.0@wicourts.gov>
	<a1ec7d000811061305n7b28800od469c1411e1a9928@mail.gmail.com>
	<dcc563d10811061405l76cb59adh58741b227fe9d8a6@mail.gmail.com>
	<49131C67.EE98.0025.0@wicourts.gov>
	<dcc563d10811061445h32c5ad72o84f367d7cc3c6899@mail.gmail.com>
	<49132383.EE98.0025.0@wicourts.gov>
	<dcc563d10811061603t574c74afj4f651c4ec7dbb88d@mail.gmail.com>
	<72dbd3150811061821ub30ec93x4da25b82060e5d29@mail.gmail.com>
	<20081107031921.GE15954@yugib.highrise.ca>

Seems like this didn't make it through to the list the first time...

* Aidan Van Dyk <aidan@highrise.ca> [081106 22:19]:
> * David Rees <drees76@gmail.com> [081106 21:22]:
>  
> > 2. A write barrier instructs the lower level hardware that commands
> > issued before the barrier must be written to disk before commands
> > issued after the barrier. Write barriers are used to ensure that data
> > written to disk is written in such a way as to maintain filesystem
> > consistency, without losing all the benefits of a write cache.
> > 
> > 3. A fsync call forces data to be synced to the controller.
> > 
> > This means that whenever you call fsync, at the very minimum, the data
> > will have made it to the controller. How much further down the line
> > will depend on whether or not the controller is in WriteBack or
> > WriteThrough mode and whether or not the disk is also caching writes.
> > 
> > So in your example, if the OS is caching some writes and fsync is
> > called, it won't be returned until at a minimum the controller has
> > accepted all the data, regardless of whether or not write barriers are
> > enabled.
> > 
> > In theory, it should be safe to disable write barriers if you have a
> > BBU because the BBU should guarantee that all writes will eventually
> > make it to disk (or at least reduce the risk of that not happening to
> > an acceptable level).
> 
> All that's "correct", but note that fsync doesn't guarentee *coherent*
> filesystem state has been made to controller.  And fsync *can* carry "later"
> writes to the controller.
> 
> I belive the particular case the prompted the write-barriers to become default
> was ext3 + journals, where in certain (rare) cases, upon recovery, things were
> out of sync.  What was happening was that ext3 was syncing the journal, but
> "extra" writes were getting carried to the controller during the sync
> operation, and if something crashed at the right time, "new" data was on the
> disk where the "old journal" (because the new journal hadn't finished making
> it to the controller) didn't expect it.
> 
> The write barriers give the FS the symantics to say "all previous queue
> writes" [BARRIER] flush to controller [BARRIER] "any new writes", and thus
> guarentee the ordering of certian operations to disk, and guarentee coherency
> of the FS at all times.
> 
> Of course, that guarenteed FS consistency comes at a cost.  As to it's
> necessity with the way PG uses the FS w/ WAL....  or it's necessity with
> xfs...
> 
> a.
> 
> -- 
> Aidan Van Dyk                                             Create like a god,
> aidan@highrise.ca                                       command like a king,
> http://www.highrise.ca/                                   work like a slave.



-- 
Aidan Van Dyk                                             Create like a god,
aidan@highrise.ca                                       command like a king,
http://www.highrise.ca/                                   work like a slave.

Attachments:

  signature.asc (application/pgp-signature, 188B) download

view thread (17+ messages)

Message-ID: <20081111150753.GA31053@yugib.highrise.ca>
Permalink:  ../20081111150753.GA31053@yugib.highrise.ca/
Also on:    postgresql.org/message-id/20081111150753.GA31053@yugib.highrise.ca

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-performance@postgresql.org
  Cc: aidan@highrise.ca
  Subject: Re: Create and drop temp table in 8.3.4
  In-Reply-To: <20081111150753.GA31053@yugib.highrise.ca>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox