Thread (19 messages) 19 messages, 8 authors, 2017-05-09

Re: RAID creation resync behaviors

From: David Brown <hidden>
Date: 2017-05-03 21:06:01

On 03/05/17 22:27, Shaohua Li wrote:
Hi,

Currently we have different resync behaviors in array creation.

- raid1: copy data from disk 0 to disk 1 (overwrite)
- raid10: read both disks, compare and write if there is difference (compare-write)
- raid4/5: read first n-1 disks, calculate parity and then write parity to the last disk (overwrite)
- raid6: read all disks, calculate parity and compare, and write if there is difference (compare-write)

Write whole disk is very unfriendly for SSD, because it reduces lifetime. And
if user already does a trim before creation, the unncessary write could make
SSD slower in the future. Could we prefer compare-write to overwrite if mdadm
detects the disks are SSD? Surely sometimes compare-write is slower than
overwrite, so maybe add new option in mdadm. An option to let mdadm trim SSD
before creation sounds reasonable too.
When doing the first sync, md tracks how far its sync has got, keeping a 
record in the metadata in case it has to be restarted (such as due to a 
reboot while syncing).  Why not simply /not/ sync stripes until you 
first write to them?  It may be that a counter of synced stripes is not 
enough, and you need a bitmap (like the write intent bitmap), but it 
would reduce the creation sync time to 0 and avoid any writes at all.

David

Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help