brintos

brintos / linux-shallow public Read only

0
0
Text · 2.7 KiB · 357e551 Raw
48 lines · plain
1==================2Partial Parity Log3==================4 5Partial Parity Log (PPL) is a feature available for RAID5 arrays. The issue6addressed by PPL is that after a dirty shutdown, parity of a particular stripe7may become inconsistent with data on other member disks. If the array is also8in degraded state, there is no way to recalculate parity, because one of the9disks is missing. This can lead to silent data corruption when rebuilding the10array or using it is as degraded - data calculated from parity for array blocks11that have not been touched by a write request during the unclean shutdown can12be incorrect. Such condition is known as the RAID5 Write Hole. Because of13this, md by default does not allow starting a dirty degraded array.14 15Partial parity for a write operation is the XOR of stripe data chunks not16modified by this write. It is just enough data needed for recovering from the17write hole. XORing partial parity with the modified chunks produces parity for18the stripe, consistent with its state before the write operation, regardless of19which chunk writes have completed. If one of the not modified data disks of20this stripe is missing, this updated parity can be used to recover its21contents. PPL recovery is also performed when starting an array after an22unclean shutdown and all disks are available, eliminating the need to resync23the array. Because of this, using write-intent bitmap and PPL together is not24supported.25 26When handling a write request PPL writes partial parity before new data and27parity are dispatched to disks. PPL is a distributed log - it is stored on28array member drives in the metadata area, on the parity drive of a particular29stripe.  It does not require a dedicated journaling drive. Write performance is30reduced by up to 30%-40% but it scales with the number of drives in the array31and the journaling drive does not become a bottleneck or a single point of32failure.33 34Unlike raid5-cache, the other solution in md for closing the write hole, PPL is35not a true journal. It does not protect from losing in-flight data, only from36silent data corruption. If a dirty disk of a stripe is lost, no PPL recovery is37performed for this stripe (parity is not updated). So it is possible to have38arbitrary data in the written part of a stripe if that disk is lost. In such39case the behavior is the same as in plain raid5.40 41PPL is available for md version-1 metadata and external (specifically IMSM)42metadata arrays. It can be enabled using mdadm option --consistency-policy=ppl.43 44There is a limitation of maximum 64 disks in the array for PPL. It allows to45keep data structures and implementation simple. RAID5 arrays with so many disks46are not likely due to high risk of multiple disks failure. Such restriction47should not be a real life limitation.48