linux-raid.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Philip Molter <philip@corp.texas.net>
To: linux-raid@vger.kernel.org
Subject: Re: Force parity resync on raid5?
Date: Thu, 12 Aug 2004 12:07:36 -0500	[thread overview]
Message-ID: <411BA3D8.5030901@corp.texas.net> (raw)
In-Reply-To: <411B9A2C.6090108@dgreaves.com>

> Anyway - the question remains - would this be the right approach?
> 
> Hmm - I wonder what would be needed to make the resync code do this...

No, it wouldn't.  In RAID5 implementations, parity isn't recalculated 
when you write to a RAID,  It's updated.  My understanding is that 
typical implementations are, *VERY* basically:

read the old data
xor with the new data
read the parity data
xor with the parity data
write the new data
write the new parity data

Thus a RAID5 write is really two disk reads and two disk writes, which 
is why RAID5 is expensive for writing.  Under this scheme, if the parity 
is bad, and you write data to "update" it, it's still bad because you 
haven't recalculated anything.  If the parity is good, everything stays 
in sync.

If you were to truly recalculate parity every time you wrote to a block, 
it'd be something like:

write the new data
read the corresponding data blocks from the other drives
recalculate parity based on all blocks
write the new parity data

That would be n-1 reads and 2 writes for every write, which would get 
expensive as your number of drives increased.  It's something like this 
that the update=resync option in mdadm does, that is it reads every 
drive's data and actually recalculates the parity based on that.

Philip

  reply	other threads:[~2004-08-12 17:07 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-09 23:10 Force parity resync on raid5? Philip Molter
2004-08-10  9:04 ` Gordon Henderson
2004-08-12  4:06   ` Guy
2004-08-12 11:52     ` Philip Molter
2004-08-12 12:31     ` David Greaves
2004-08-12 15:22       ` Guy
2004-08-12 16:26         ` David Greaves
2004-08-12 17:07           ` Philip Molter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-08-10 12:03 Philip Molter
2004-08-10 12:39 ` Neil Brown
2004-08-10 14:30   ` Philip Molter
2004-08-11  2:28     ` Neil Brown
2004-08-11  3:37       ` Philip Molter
2004-08-11  9:23       ` David Greaves
2004-08-12 17:15 Salyzyn, Mark
2004-08-12 18:16 ` Guy

Reply instructions:

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

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

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=411BA3D8.5030901@corp.texas.net \
    --to=philip@corp.texas.net \
    --cc=linux-raid@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).