Open tigerblue77 opened 5 years ago
@tigerblue77 do you need any help here? I notice there are a few failing tests.
For instance in the RaidTenTest, you changed the capacity of one of the drives in the test, but didn'tupdate the result.
@kevinquinnyo hi, no thank you :) with my studies I didn't have time to repair RAID 10 until now but I'll do ASAP
Failing tests are corrects, I edited them because they were wrong I think ;)
And I changed a drive to make an heterogen drive array but, as there is no pair for this drive size in the array, the RAID10 will only use the size of the second biggest drive
For example if you have 3 1tb drives and one 2tb drive, the raid 10 will create 2 raid 1 of 1 tb usable and 1 tb for mirroring (so 1tb will stay unused on the 2tb drive) and merge them in a RAID 0 (as raid 10 is in fact RAID 1+0)
For example if you have 3 1tb drives and one 2tb drive, the raid 10 will create 2 raid 1 of 1 tb usable and 1 tb for mirroring (so 1tb will stay unused on the 2tb drive) and merge them in a RAID 0 (as raid 10 is in fact RAID 1+0)
Oh I see. A RAID 10 is basically invalid with 5 drives. The code is summing the capacity of all 5 (truncating the 2048 to 1024) and resulting in (1024 * 5) / 2 = 2560
.
So that is a bug. Good catch. I haven't looked at this code in a long time.
Yes that's it. I think "invalid" is not the right term, as the RAID will be created but as it needs pairs of drives, one drive of the five composing the array will not be used :) And the algorithm is a little bit more complicated as it will try to make pairs of the same drive capacity to reduce the lost space and maximize the usable space. In fact, in general you only create raid 10 with identical drives as it will have no lost space
Thank you :) no problem
I wonder if this library should throw an exception if you pass 5 drives to a raid 10, unless you set one of the drives as a hot spare?
Should hotSpare
be a property of a Drive
, or should the Raid
objects have a $hotSpares (array)
property instead?
I never gave this too much thought and I'm not super knowledgable on RAID. What do you think?
edit: my instinct is that we should throw InvalidArgumentException
if you pass 5 drives to a RAID10 and one of them is not marked as a hotSpare
.
I wonder if this library should throw an exception if you pass 5 drives to a raid 10, unless you set one of the drives as a hot spare?
Sorry but I think it's not a good idea as it is not impossible to build a RAID 10 with 5 drives... 1 drive will stay unused and will not be part of the RAID but it's still possible. In my opinion, an exception should only be throwed when an impossible case is reached.
Should
hotSpare
be a property of aDrive
, or should theRaid
objects have a$hotSpares (array)
property instead?I never gave this too much thought and I'm not super knowledgable on RAID. What do you think?
edit: my instinct is that we should
throw InvalidArgumentException
if you pass 5 drives to a RAID10 and one of them is not marked as ahotSpare
.
No problem :)
I think it should be a drive's property (as boolean) because it is more logical and if it's an array, when a drive is failling, you're obliged to remove the object from the spare array to move it to the used drives array... It's not efficient ;)
I don't know why "Travis CI" check is failing on GitHub when I push... Could you look at this please ? :)
I'm working on RAID 10... The algorithm to calculate the capacity is the same as the one used to calculate de parity size, how would you do to avoid code duplication ? :)
edit: Normally everything is now working great, don't hesitate to ask me for changes or if you don't understand some of my programming choices :)
Do you have ideas of new functionnalities ?
Hi @kevinquinnyo,
Did you have time to look at the changes I made ? :)
Did you have time to look at the changes I made ? :)
No I'm really sorry! I have been really busy with work and planning a wedding. I am looking forward to finding some time to look through this and help you land your changes though.
No I'm really sorry! I have been really busy with work and planning a wedding. I am looking forward to finding some time to look through this and help you land your changes though.
No problem ! I'll wait for your return, there is no emergency :)
Codecov Report
0% <0%> (ø)
14 <14> (?)
100% <100%> (ø)
11 <0> (-1)
62.5% <33.33%> (-37.5%)
6 <2> (+1)
62.5% <33.33%> (-37.5%)
6 <2> (+2)
62.5% <44.44%> (-37.5%)
6 <2> (+1)
62.5% <44.44%> (-37.5%)
6 <2> (+2)
62.5% <44.44%> (-37.5%)
6 <2> (+2)
76.33% <48.33%> (-23.67%)
58 <39> (+25)
77.27% <77.27%> (ø)
10 <10> (?)
92.59% <84.61%> (-7.41%)
9 <9> (+2)
Continue to review full report at Codecov.