pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
IDE and write cache
3+ messages / 3 participants
[nested] [flat]

* IDE and write cache
@ 2004-02-11 06:14 Mark Lubratt <mark.lubratt@indeq.com>
  2004-02-11 15:48 ` Re: IDE and write cache scott.marlowe <scott.marlowe@ihs.com>
  2004-02-11 16:21 ` Re: IDE and write cache Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 3+ messages in thread

From: Mark Lubratt @ 2004-02-11 06:14 UTC (permalink / raw)
  To: pgsql-admin

Interesting discussions on IDE drives and their write caches.

I have a question...

You mentioned that you'd see the problem during a large number of 
concurrent transactions.  My question is, is this a necessary condition 
for the database crashing when the plug was pulled, or did you need use 
a large number of concurrent transactions to "guarantee" that when you 
pulled the plug, that it would be at an inopportune time?  In other 
words, is an IDE drive still "more" susceptible to a power outage 
problem even under light load?

Thanks!
Mark




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: IDE and write cache
  2004-02-11 06:14 IDE and write cache Mark Lubratt <mark.lubratt@indeq.com>
@ 2004-02-11 15:48 ` scott.marlowe <scott.marlowe@ihs.com>
  1 sibling, 0 replies; 3+ messages in thread

From: scott.marlowe @ 2004-02-11 15:48 UTC (permalink / raw)
  To: Mark Lubratt <mark.lubratt@indeq.com>; +Cc: pgsql-admin

On Wed, 11 Feb 2004, Mark Lubratt wrote:

> Interesting discussions on IDE drives and their write caches.
> 
> I have a question...
> 
> You mentioned that you'd see the problem during a large number of 
> concurrent transactions.  My question is, is this a necessary condition 
> for the database crashing when the plug was pulled, or did you need use 
> a large number of concurrent transactions to "guarantee" that when you 
> pulled the plug, that it would be at an inopportune time?  In other 
> words, is an IDE drive still "more" susceptible to a power outage 
> problem even under light load?

Basically, if the data has been written to WAL, and an fsync issued, and 
the drive has it in cache, but hasn't written it to the platters, and you 
lose power, the database will likely be corrupted and will refuse to 
startup when the machine boots up.  Also, of course, some data will be 
lost that was supposedly committed in a transaction.

So, yeah, the reason for having hundreds of open transactions is that it 
makes the window of opportunity for a lying drive to corrupt the database.

So, yes, even under light load, you could have a corrupted database if you 
lose power while a write is happening.  Of course, if the database is 
sitting idle at the time of the power outage then you're ok.

-------------------------------------------------------------------------

Funny little story.  We had an electrician working above our main power 
switch (the big box that switches us from line power, to UPS, to the 
diesel generator) and said electrician clipped a piece of wire that fell 
into the switch, shorting it out, and taking down our entire hosting 
center (think $1,000 a minute...)

As I was walking down a hallway, one of the winders / fox pro guys asked 
me if my machine would come back up when the power came on (it runs on 
dial 36 gig 10krpm SCSI drives under an LSI megaraid with battery backed 
cache, and I've tested it pulling the plug before going production.)  I'd 
been bragging to him about the power plug pull tests it had passed, so of 
course, he's just teasing me.

I told him that as long as the power cut hadn't spiked the box and fried 
anything we were gold.

An hour later when they got the switch fixed and everything came back up, 
my machine came up fine, but the NAS machines that provide the web storage 
behind it (not the database, that's local) took about 10 minutes to fsck 
or mount or whatever it is they do.

So I'm walking by foxpro guy's desk and I casually say "Well, looks like 
my box had some problems coming back up."  He smiles, thinking he's got 
me, the bragging postgresql guy, by the short ones.  "yeah, seems it boots 
faster than the network storage it sits on.  Just CTRL-ALT-DEL and it was 
up and running fine."  He laughed along with me.  I trust Postgresql.  On 
SCSI or RAID with battery backed cache.




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: IDE and write cache
  2004-02-11 06:14 IDE and write cache Mark Lubratt <mark.lubratt@indeq.com>
@ 2004-02-11 16:21 ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2004-02-11 16:21 UTC (permalink / raw)
  To: Mark Lubratt <mark.lubratt@indeq.com>; +Cc: pgsql-admin

Mark Lubratt <mark.lubratt@indeq.com> writes:
> You mentioned that you'd see the problem during a large number of 
> concurrent transactions.  My question is, is this a necessary condition 
> for the database crashing when the plug was pulled, or did you need use 
> a large number of concurrent transactions to "guarantee" that when you 
> pulled the plug, that it would be at an inopportune time?  In other 
> words, is an IDE drive still "more" susceptible to a power outage 
> problem even under light load?

A heavy load makes it more likely that you'd see the problem, but only
because it improves the odds that there will be data "in flight" at the
instant the power drops.  You can still lose on a lightly loaded system
if your luck is bad.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2004-02-11 16:21 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-02-11 06:14 IDE and write cache Mark Lubratt <mark.lubratt@indeq.com>
2004-02-11 15:48 ` scott.marlowe <scott.marlowe@ihs.com>
2004-02-11 16:21 ` Tom Lane <tgl@sss.pgh.pa.us>

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