Hacker News new | ask | show | jobs
by cyphar 2340 days ago
This article makes a few mistakes with regards to ZFS. Some are understandable (the author presumably last looked at the state of ZFS 5 years ago), but some were not true even 5 years ago:

> If you want to grow the pool, you basically have two recommended options: add a new identical vdev, or replace both devices in the existing vdev with higher capacity devices.

You can add vdevs to a pool which are different types or have different parities. It's not really recommended because it means that you're making it harder to know how many failures your pool can survive, but it's definitely something you can do -- and it's just as easy as adding any other vdev to your pool:

  % zpool add <pool> <vdev> <devices...>
This has always been possible with ZFS, as far as I'm aware.

> So let’s say you had no writes for a month and continual reads. Those two new disks would go 100% unused. Only when you started writing data would they start to see utilization

This part is accurate...

> and only for the newly written files.

... but this part is not. Modifying an existing file will almost certainly result in data being copied to the newer vdev -- because ZFS will send more writes to drives that are less utilised (and if most of the data is on the older vdevs, then most reads are to the older vdevs, and thus the newer vdevs get more writes).

> It’s likely that for the life of that pool, you’d always have a heavier load on your oldest vdevs. Not the end of the world, but it definitely kills some performance advantages of striping data.

This is also half-true -- it's definitely not ideal that ZFS doesn't have a defrag feature, but the above-mentioned characteristic means that eventually your pool will not be so unbalanced.

> Want to break a pool into smaller pools? Can’t do it. So let’s say you built your 2x8 + 2x8 pool. Then a few years from now 40 TB disks are available and you want to go back to a simple two disk mirror. There’s no way to shrink to just 2x40.

This is now possible. ZoL 0.8 and later support top-level mirror vdev removal.

> Got a 4-disk raidz2 pool and want to add a disk? Can’t do it.

It is true that this is not possible at the moment, but in the interest of fairness I'd like to mention that it is currently being worked on[1].

> For most fundamental changes, the answer is simple: start over. To be fair, that’s not always a terrible idea, but it does require some maintenance down time.

This is true, but I believe that the author makes it sound much harder than it actually is (it does have some maintenance downtime, but because you can snapshot the filesystem the downtime can be as little as a minute):

    # Assuming you've already created the new pool $new_pool.
    % zfs snapshot -r $old_pool/ROOT@base_snapshot
    % zfs send $old_pool/ROOT@base_snapshot | zfs recv $new_pool/ROOT

    # The base copy is done -- no downtime. Now we take some downtime by stopping all use of the pool.
    % take_offline $old_pool # or do whatever it takes for your particular system
    % zfs mount -o ro $old_pool/ROOT # optional
    % zfs snapshot -r $old_pool/ROOT@last_snapshot
    % zfs send -i @base_snapshot $old_pool/ROOT@last_snapshot | zfs recv $new_pool/ROOT

    # Finally, get rid of the old pool and add our new pool.
    % zpool export $old_pool
    % zpool import $new_pool $old_pool
    % zfs mount -a # probably optional
[1]: https://www.youtube.com/watch?v=Njt82e_3qVo