PERFORCE change 123662 for review
Pawel Jakub Dawidek
pjd at FreeBSD.org
Mon Jul 23 10:37:31 UTC 2007
On Fri, Jul 20, 2007 at 03:07:16PM +0200, Alexander Leidinger wrote:
> Quoting Ulf Lilleengen <lulf at FreeBSD.org> (Fri, 20 Jul 2007 14:35:24 +0200):
>
> [growing RAID-5]
> > Well, what I do is to attach/create the new subdisk as usual, but since it's a
> > RAID-5 array that I know is operational, I give the subdisk a flag, and sets the
> > plex in a resize state. Then, In the raid-5 code, I modify gv_raid5_offset
> > (which basically computes offsets within a subdisk based on the number of
> > subdisks and stripesize). However, what I do, is that instead of taking all
> > subdisks in the calculation, I only take those who does not have the GROW flag
> > (when reading), and I take all subdisks into calculation when it's a write.
> >
> > This means, that if a create a gv_grow_plex function that reads (stripesize x
> > sdcount) bytes (from the subdisks that do not have the GROW flag), and writes
> > that data to the plex (including all subdisks). This way, i sort of overwrite
> > the old data, but the data is spread out over the new subdisks. I'm sorry if
> > this might seem a bit complex, but just ask more questions if you didn't
> > understand.
>
> Do you use the additional drive(s) only to write checksums to them, or
> do you write real data to it? If the later, how do you make sure you
> read the right data in case you read data again, which was just written
> there a moment before (how do you know to read from all subdisks and
> not only from a subset in this case)?
You only need to move offset while you synchronize new disk.
When you start you have:
Disk0 Disk1 Disk2 NewDisk
D0 D1 P0 U
D2 P1 D3 U
P2 D4 D5 U
D6 D7 P3 U
D8 P4 D9 U
P5 D10 D11 U
After some time you have:
Disk0 Disk1 Disk2 NewDisk
D0 D1 D2 NP0
D3 D4 NP1 D5
U U U U
--> D6 D7 P3 U
D8 P4 D9 U
P5 D10 D11 U
And at the end you have:
Disk0 Disk1 Disk2 NewDisk
D0 D1 D2 NP0
D3 D4 NP1 D5
D6 NP2 D7 D8
NP3 D9 D10 D11
U U U U
U U U U
Where:
D<x> - data block
P<x> - parity block
NP<x> - new parity block
U - unused
--> - if offset in I/O request is below that point, you use four disks,
if it is above that point you use only three disks
BTW. Such functionality is really cool.
--
Pawel Jakub Dawidek http://www.wheel.pl
pjd at FreeBSD.org http://www.FreeBSD.org
FreeBSD committer Am I Evil? Yes, I Am!
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 187 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/p4-projects/attachments/20070723/82baa8cb/attachment.pgp
More information about the p4-projects
mailing list