Documentation/driver-api/md/raid5-ppl.rst GitHub 원문 ↗

Linux 6.18.37 · Driver API

Partial Parity Log

RAID5 write hole을 막기 위해 수정하지 않은 chunk의 XOR을 parity drive metadata area에 분산 기록하는 PPL 설계입니다.

Source pathDocumentation/driver-api/md/raid5-ppl.rst
Source versionLinux v6.18.37
TranslationDUJINLABS 전문 번역 + 해설

요약·해설과 원문, 전문 번역을 서로 분리했습니다. API 이름, symbol, source path는 원문 표기를 사용합니다.

1. 요약·해설

원문의 핵심 논리와 kernel programming 관점의 보충 설명입니다. 아래의 전문 번역과는 별도로 작성했습니다.

요약과 해설

raid5-ppl.rst:1-47

PPL은 수정하지 않은 stripe chunk의 XOR을 해당 parity drive의 metadata area에 먼저 기록해 dirty degraded RAID5의 silent corruption을 막습니다. 전용 journal disk가 없고 확장성이 좋지만 true data journal은 아니므로 in-flight data loss를 보호하지 않습니다.

2. 영어 원문 전체

번역 기준이 된 Linux v6.18.37 원문입니다. 줄 번호는 이 버전의 파일 좌표입니다.

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

3. 한국어 전문 번역

영어 원문의 문단 순서와 의미를 유지한 전체 번역입니다. 코드, 함수명, symbol과 URL은 원문 표기를 유지합니다.

Partial Parity Log와 RAID5 write hole

1-14

Partial Parity Log(PPL)은 RAID5 array에서 사용할 수 있는 기능입니다. Dirty shutdown 뒤 특정 stripe parity가 다른 member disk의 data와 일치하지 않을 수 있는 문제를 다룹니다.

Array가 degraded 상태라 disk 하나가 빠져 있으면 parity를 다시 계산할 방법이 없습니다. 그 상태로 array를 rebuild하거나 degraded mode로 사용하면 unclean shutdown 중 write request가 닿지 않았던 array block조차 parity에서 잘못 복원되어 silent data corruption이 생길 수 있습니다. 이 상태가 RAID5 Write Hole입니다.

이 위험 때문에 MD는 기본적으로 dirty degraded array를 시작하지 못하게 합니다.

Dirty degraded RAID5 위험
Dirty shutdown일부 stripe의 data·parity 불일치Member disk 하나 missingParity 재계산 불가Degraded 사용 또는 rebuildParity 기반 block 복원이 잘못됨Silent data corruption

Missing disk와 inconsistent parity가 결합될 때 silent corruption으로 이어집니다.

Partial parity의 복구 원리

15-25

Write operation의 partial parity는 이번 write가 수정하지 않는 stripe data chunk들을 XOR한 값입니다. Write hole에서 복구하는 데 필요한 최소 data입니다.

Partial parity를 수정된 chunk들과 XOR하면, 어느 chunk write까지 완료되었는지와 무관하게 write 전 stripe 상태와 일치하는 parity를 얻습니다. 이 stripe에서 수정되지 않은 data disk 하나가 빠졌다면 갱신한 parity로 그 내용을 recover할 수 있습니다.

모든 disk가 있는 상태로 unclean shutdown 뒤 array를 시작할 때도 PPL recovery를 수행하므로 전체 array resync가 필요 없습니다. 이 때문에 write-intent bitmap과 PPL을 함께 사용하는 것은 지원하지 않습니다.

Partial parity XOR 관계
수정하지 않은 stripe chunk들을 XORPartial parity 생성·기록새로 수정된 chunk와 XORWrite 전 상태와 일치하는 stripe parity 복원Missing unmodified chunk가 있으면 parity로 복구

수정하지 않은 chunk의 XOR과 새 chunk를 결합해 일관된 parity를 만듭니다.

PPL write와 distributed log

26-33

Write request를 처리할 때 PPL은 새 data와 parity를 disk에 dispatch하기 전에 partial parity를 기록합니다.

PPL은 distributed log입니다. Array member drive의 metadata area 가운데 해당 stripe의 parity drive에 저장하므로 전용 journaling drive가 필요 없습니다.

Write 성능은 최대 30~40% 감소하지만 array drive 수에 따라 확장됩니다. 별도 journaling drive가 bottleneck 또는 single point of failure가 되지 않는 장점이 있습니다.

Distributed PPL placement
Write request수정하지 않은 chunk의 partial parity 계산해당 stripe parity drive의 metadata area에 PPL 기록새 data·parity를 member drive에 dispatch전용 journal disk 불필요

각 stripe의 parity drive가 해당 partial parity log를 보관합니다.

PPL이 보호하는 범위

34-40

PPL은 MD의 다른 write-hole 대책인 `raid5-cache`와 달리 true journal이 아닙니다. In-flight data loss를 막지 않고 silent data corruption만 방지합니다.

Stripe의 dirty disk가 유실되면 그 stripe에는 PPL recovery를 수행하지 않아 parity도 갱신하지 않습니다. 이 경우 stripe의 write된 부분에는 임의의 data가 남을 수 있고 동작은 일반 RAID5와 같습니다.

PPL과 raid5-cache의 보호 범위
항목PPLraid5-cache
Write hole방지방지
Silent corruption방지방지
In-flight data loss보호하지 않음Journal mode에 따라 보호
전용 journal disk불필요필요
Dirty stripe disk 유실PPL recovery 생략Cache log recovery 가능성

PPL은 consistency record이지 data journal이 아닙니다.

지원 metadata, 활성화와 제한

41-47

PPL은 MD version-1 metadata와 external metadata array, 구체적으로 IMSM에서 사용할 수 있습니다. `mdadm --consistency-policy=ppl` option으로 활성화합니다.

PPL array는 최대 64개 disk로 제한됩니다. 이 제한은 data structure와 구현을 단순하게 유지합니다. Disk가 매우 많으면 multiple disk failure 위험이 커 RAID5를 사용할 가능성이 낮으므로 실제 환경에서 큰 제약이 되지는 않을 것으로 봅니다.

PPL 사용 조건
항목조건
RAID levelRAID5
Native metadataMD version-1
External metadataIMSM
활성화mdadm --consistency-policy=ppl
write-intent bitmap 병용지원하지 않음
최대 disk64

지원 metadata와 운영 제한입니다.