Description
Describe the feature would like to see added to OpenZFS
The idea is to allow for special
devices to be configured for a pool in a "write-through" mode such that any record assigned to a special vdev is also written to a non-special vdev as well. As a result the special device will not require the same guarantee for redundancy as the rest of the pool (it could be a single disk and still be perfectly safe, in the same way as a cache
device).
Initially this would simply be an option when adding the device; in this way the "write-through" special
device is no different to a normal one, in that you will see no benefit until special records start being written.
At a later time (possibly as a separate feature) it would be good to also see the ability to change a special
device's mode, i.e- changing an existing special
device to "write-through" mode would cause all records currently stored within it to be copied to non-special vdevs, and once complete it can be lost without any data loss. While removing "write-through" mode would cause copying of special records to non-special vdevs stop (but any existing copies would remain in place, same as for a change of copies=N
).
How will this feature improve OpenZFS?
This will allow for the use of a special
vdev with less (or no) redundancy compared to the rest of the pool, without the risk of data loss, while still accelerating reading of special records (metadata, small files etc.).
Additional context
This feature is an alternative to #15051 (record size limit for ARC/L2ARC). While #15051 would be the easier to implement, this one is the more "correct" since it also accelerates smaller record reading but in a more predictable way since it can (with a suitable special
device) guarantee that all such records are accelerated, rather than just whichever ones happen to remain in ARC/L2ARC long enough to be used.
There is also a side-issue #15226 for filling special
vdevs which is important but not critical for the write-through case; while loss of a write-through special device should be safe (no data lost), once replaced there will be no special records on the new device meaning performance is lost instead, so filling is important to "reload/resilver" the new device.