Re: Excessive (and slow) fsync() within single transaction

From: Greg Smith <greg(at)2ndquadrant(dot)com>
To: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>
Cc: Scott Marlowe <scott(dot)marlowe(at)gmail(dot)com>, Stephen Tyler <stephen(at)stephen-tyler(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Excessive (and slow) fsync() within single transaction
Date: 2009-12-09 21:49:26
Message-ID: 4B201B66.8050108@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Ron Mayer wrote:
> Scott Marlowe wrote:
>
>> Actually, it's usually the drives that lie about fsync, especially
>> consumer grade (and some server grade) SATA / PATA drives are known
>> for this.
>>
>
> I'm still looking for any evidence of any drive that lies.
> Is there actually a drive which claims to support the
> IDE "FLUSH_CACHE_EXT" feature (IDE command 0xEA) that doesn't?!?
>
You seem to think that a "lying drive" is one that doesn't flush its
cache when you ask it to. That's not the definition, and as you point
out it's rare behavior--some crappy drives would do this many years ago
when the drive flush was a new thing, nowadays that's unheard of.

But back in the day, when you wrote to a drive, it never returned
success until that write was done. Anything that doesn't have that
behavior was considered a "lying drive". It was something that consumer
drives did but "enterprise" ones didn't.

Nowadays, most drives do this, and the various cache flush calls allow
one to work around it. But the drives still "lie" from some viewpoints,
simply because the write calls don't wait for completion before
returning success, the original criteria. If you're naive and believe
that anything the drive has said is written is actually on disk, which
used to be how things worked, from that perspective all (well, almost
all) drives lie. Having that behavior documented and a workaround
available doesn't change that.

--
Greg Smith 2ndQuadrant Baltimore, MD
PostgreSQL Training, Services and Support
greg(at)2ndQuadrant(dot)com www.2ndQuadrant.com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-12-09 21:54:53 Re: Excessive (and slow) fsync() within single transaction
Previous Message Greg Smith 2009-12-09 21:38:50 Re: Excessive (and slow) fsync() within single transaction