raid5-ppl.txt 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. Partial Parity Log
  2. Partial Parity Log (PPL) is a feature available for RAID5 arrays. The issue
  3. addressed by PPL is that after a dirty shutdown, parity of a particular stripe
  4. may become inconsistent with data on other member disks. If the array is also
  5. in degraded state, there is no way to recalculate parity, because one of the
  6. disks is missing. This can lead to silent data corruption when rebuilding the
  7. array or using it is as degraded - data calculated from parity for array blocks
  8. that have not been touched by a write request during the unclean shutdown can
  9. be incorrect. Such condition is known as the RAID5 Write Hole. Because of
  10. this, md by default does not allow starting a dirty degraded array.
  11. Partial parity for a write operation is the XOR of stripe data chunks not
  12. modified by this write. It is just enough data needed for recovering from the
  13. write hole. XORing partial parity with the modified chunks produces parity for
  14. the stripe, consistent with its state before the write operation, regardless of
  15. which chunk writes have completed. If one of the not modified data disks of
  16. this stripe is missing, this updated parity can be used to recover its
  17. contents. PPL recovery is also performed when starting an array after an
  18. unclean shutdown and all disks are available, eliminating the need to resync
  19. the array. Because of this, using write-intent bitmap and PPL together is not
  20. supported.
  21. When handling a write request PPL writes partial parity before new data and
  22. parity are dispatched to disks. PPL is a distributed log - it is stored on
  23. array member drives in the metadata area, on the parity drive of a particular
  24. stripe. It does not require a dedicated journaling drive. Write performance is
  25. reduced by up to 30%-40% but it scales with the number of drives in the array
  26. and the journaling drive does not become a bottleneck or a single point of
  27. failure.
  28. Unlike raid5-cache, the other solution in md for closing the write hole, PPL is
  29. not a true journal. It does not protect from losing in-flight data, only from
  30. silent data corruption. If a dirty disk of a stripe is lost, no PPL recovery is
  31. performed for this stripe (parity is not updated). So it is possible to have
  32. arbitrary data in the written part of a stripe if that disk is lost. In such
  33. case the behavior is the same as in plain raid5.
  34. PPL is available for md version-1 metadata and external (specifically IMSM)
  35. metadata arrays. It can be enabled using mdadm option --consistency-policy=ppl.
  36. There is a limitation of maximum 64 disks in the array for PPL. It allows to
  37. keep data structures and implementation simple. RAID5 arrays with so many disks
  38. are not likely due to high risk of multiple disks failure. Such restriction
  39. should not be a real life limitation.