Request: Broad explanation of the Mathematics behind dual parity


Anon
Go to solution Solved by trurl,

Recommended Posts

Hello,

 

TLDR: I want to know (in broad terms) how exactly Unraids implementation of Parity2 works.

 

the way single parity works is very easy to understand.

When it comes to dual parity there are a lot of forum posts, reddit posts, youtube videos, the Unraid Wiki itself talking about "reed Solomon code" or "p+q parity" etc. I understand the practical effects of the second parity that Unraid provides and I generally understand the mentioned parity algorithms. But those concepts don't really work with how Unraid is actually implementing them.

 

Unraid keeps "Parity 1" the same so it still calculates the Odd / Even situation. Parity 2 is somehow able to recreate one disk by itself (if the other parity and one drive fails) and also recreate 2 drives together with  the information parity 1 can provide.

Is there some sort of Search term for the algorithm used that I can use to find out more? All the "normal" dual parity mathematics always assume both parity drives to work the same with their algorithm and do not work with 2 different types of parity. Or spread the parity data between the drives (Like Raid 6) which is also not what unraid does.

 

Is anyone well versed enough to point me in the right direction? Or is this a totally new algorithm Unraid developed (modified) and is keeping as a "Trade secret"? I am currently finishing up my master degree in this type of topic so I guess its mainly personal interest that is driving me to actually understand how this works mathematically.

 

In a dual failure scenario parity 1 can say if the 2 values of the added disks together should be odd or even. (if even either 0,0 or 1,1, if odd either 0,1 or 1,0). The second parity's "Magic" needs to find out which of those 2 options it is based on what it has stored itself.

 

(I hope this category is correct. Its not really "Support" and more a question about understanding but I just copied the category from this post that also touched upon dual parity (sadly they never explain how its actually done):

Link to comment

Not quite sure what the confusion is?

 

Parity1 can calculate the correct bits for 1 failed disk.  Parity2 can do the same for a second drive using a different algorithm (ignoring parity1).   As such they are independent of each other.

 

if you want the exact details of the parity2 algorithm then I have no idea other than the fact it includes the drive slot as one of the elements and that the algorithm is such that a 0 byte on a data drive does not change the calculated result

Link to comment

@itimpi -> The confusion is on how exactly it mathematically works.

There is no confusion in how it works from a outside perspective and what it means for operating Unraid.

For a normal End User this information is completely irrelevant but I personally would like to dive deeper into how it works on a operation by operation level.

I don't just want to know that it works I wanna know why and how exactly it works.

 

I spent a few hours trying to find this info but it seems like nobody has ever actually answered in detail and just referred to "generic" algorithms on how a dual parity works in other systems.

 

I'd be willing to put up a small bounty if someone can actually answer me this. (As long as its allowed to offer such a bounty in this forum)

 

Edited by Anon
Link to comment

Hi, thanks for the link @trurl this explains it perfectly (at least at a first quick skim). And somehow I didn't find that when searching earlier. Feel stupid now. Especially since it's a easy to find Wikipedia Link...

 

Thanks a ton!

 

Edited by Anon
Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.