News for hackers. Stuff that matters.
Re:ZFS lands in Debian contrib by grigio on Saturday May 14, 2016 @07:05AM (#11695556)
So is btrfs dead?
Re:ZFS lands in Debian contrib by ansible on Saturday May 14, 2016 @11:09AM (#11696448)
No, I don't think so. I'm a small-time admin, and I think that btrfs is working pretty good these days.

We have recently switched all our servers to LXC containers so that we can take full advantage of btrfs features.

I doubt I need to explain the advantages of containers to anyone here... but in short we've broken out all the network services (file service, LDAP, DNS, etc.) to separate containers.

Each container is in a separate btrfs subvolume. This allows us to take snapshots of the running systems every 10 minutes, and using btrfs send/receive, cheaply back up those snapshots to alternate container hosts. The send/receive stuff works better with the btrfs v4.4 tools that ship with Ubuntu 16.04.

Since the network interfaces for all the containers are bridged with the container host, we can configure each container with its own static IP address. So if a container host fails, those containers can be booted up on the alternate host, and keep their IP and MAC addresses. So that's convenient, and causes minimal disruption.

The main improvement I'd like to see with btrfs is a configurable RAID redundancy level. Currently, RAID-1 means that there are two copies of each piece of data / metadata. So in a 3-drive RAID-1 system that gives you extra capacity, but two drives failing at the same time will cause data loss.

Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @02:20PM (#11697391)
Being lazy, I'm going to ask if you know of some LXC + Btrfs pros in contrast to Docker + Btrfs?

Right now a gotcha with Docker + Btrfs is that SELinux contexts for each container can be different, but the context= mount option currently is once per superblock (thus per fs volume, rather than per fs tree or subvolume). So Docker's work around in 1.10.x is they do a snapshot and then relabel it with the new selinux context then start the container. For my containers (very basic) this adds an almost imperceptible one time delay for that container. I doubt it's even 1 second, which in container start times might seem massive to some.

Re:ZFS lands in Debian contrib by ansible on Saturday May 14, 2016 @09:45PM (#11698954)
If you have already adapted to Docker, then I'm sure you don't want to use LXC.

Containers are long-lived and mutable. I treat them like old school servers, just not tied to physical hardware.

Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @09:04AM (#11695924)
btrfs is most certainly not dead. I actually think it's really gaining traction presently. It only became stable near Ubuntu 14.04 or so, and it takes people awhile (understandably) to warm up to a new filesystem.

It's great to see ZFS on Linux get a more stable footing. It's an excellent filesystem. As others have said I think the use case differs slightly from btrfs (though they are very similar in capabilities).

ZFS, to my eyes, seems more resilient. It has more levels of data checksums, The RAIDz model allows for more redundancy, and it just feels like a stronger enterprise offering (meaning stable and built for large systems and disk quantities).

btrfs brings many of the ZFS features to Linux in a GPL wrapping. What it lacks in resiliency, it makes up for with flexibility. Raid in btrfs, for instance, occurs within data chunks across disks, not at the disk level, meaning mixed disk capacities, and on the fly raid changes. I also appreciate the way it divides namespace across subvolumes while maintaining block awareness within the pool (cp --reflink across subvolumes, snapshots across subvolumes). It also doesn't have the ram requirements of ZFS (which aren't much of a data center concern, but are definitely a client level concern for workstations).

Either way it's a win, both great filesystems for Linux. With bcache supporting btrfs properly now, I personally don't have much of a reason for ZFS now. Two years ago I would have jumped easily to it. Your workloads and needs may differ, it's great to have choices!

Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @02:15PM (#11697364)
Not even close. Each merge window sees many dozens of bug fixes and enhancements, thousands of line additions and deletions. Development is very active. There are even a couple developers who are getting ants in the pants about focusing more on stabilization. The drawback of stabilization is that it increases the burden of adding new features, because any new features could reduce stability. So it's a balancing act.
Re:ZFS lands in Debian contrib by the8472 on Saturday May 14, 2016 @07:36AM (#11695644)
btrfs supports a bunch of features that ZoL does not which are useful especially on smaller systems.

among others: the ability to resize/change raid layout in place, reflink copies, on-demand deduplication.

Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @08:32AM (#11695815)
But btrfs RAID-5 still suffers from the 'write hole' problem where data can be permanently lost. We looked at RAID-5 performance for both ZFS and btrfs, and btrfs is about twice the throughput. One of the reasons for the performance difference is the following: when ZFS writes a stripe, it waits for all blocks and the parity block to confirm they have been written before atomically updating the metadata for that stripe; when btrfs writes a stripe, it just updates the metadata and all blocks in parallel. Hence if btrfs crashes, metadata may say a stripe is written but not all blocks are written. It will be interesting to see the performance hit on btrfs when they finally fix the write hole problem. My prediction is that it will perform similarly to ZFS for RAID5. Currently, for writes, we can get about 400MB/s for btrfs RAID5, but only 220MB/s for ZFS with five 5400 rpm 2.5" disks.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @08:55AM (#11695881)
Interesting findings. I'm curious also to see how fixed width stripes change the performance profile in btrfs (presently not supported). To be clear though, the raid5/6 write hole only applies to power failures with data in flight. It is still a concern, of course, but I think depending on your environment is acceptable to some (redundant PSUs, well engineered PDUs and UPS systems). Personally, I'm of increasing opinion that parity rebuilds aren't worth it anyway. I'd rather raid10, raid1, or raid0 depending on use. If I have to take a system out of production during parity rebuild (because IO activity is too intense for performant use), might as well not parity rebuild and simply reload the system on failure and rely on other cluster nodes.
Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @11:06AM (#11696435)
Raid5 is not dead yet (https://www.cafaro.net/2014/05/26/why-raid-5-is-not-dead-yet...). The problem with failures during rebuilds is overblown, IMO. Manufacturer quoted URE failure rate (probability of failure to read) is overstated - instead of 1×10^14, they are mostly like 1×10^15 or higher. Full disclosure: we're actually doing erasure coding in HDFS over Raid5 on servers (double insurance - if the raid array goes down, we can recover from other servers in HDFS). But our expectation for 6x4TB arrays is not for a 70%+ chance of a URE during a rebuild, rather a couple of percent. With ZFS or btrfs, it won't actually matter for us, as we'll only lose a block on a URE- that we can recover from the rest of the cluster.
Re:ZFS lands in Debian contrib by technion on Saturday May 14, 2016 @11:32AM (#11696533)

    The problem with failures during rebuilds is overblown
I thought I was the only one who believed that. I've said this on reddit before and ended on like -20 votes with people blatantly arguing I'm falsifying an "impossibility".

I've got roughly 30 arrays in production, between 4 and 12 disks in each. All are RAID5 + hotspare. If you believe the maths people keep quoting, the odds of seeing a total failure in a given year is close to 100%. I started using this configuration, across varying hardware, over 15 years ago and I've been growing in number since.

I'm not pretending one example proves the rule, or that it's totally safe and I would run a highly critical environment this way (before anyone comments: these environments do not meet that definition), but people have tried to show maths that there's a six nine likelihood of failure, and I just don't for a second believe I'm that lucky.

Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @04:54PM (#11697997)
Well at least on Linux, by default almost everyone (using consumer drives) has their array in a very common misconfiguration. And this leads to raid5 collapse much sooner than it should.

The misconfiguration is the drive's SCT ERC timeout is greater than the kernel's SCSI command timer. So what happens on a URE is, the drive does "deep recovery" if it's a consumer drive, and keeps trying to recover that bad sector well beyond the default command timer of the kernel, which is 30 seconds. At 30 seconds the kernel assumes something's wrong and does a link reset. On SATA drives this obliterates the command queue and any other state in the drive. The drive doesn't report a read error, doesn't report what sector had the problem, and so RAID can't do its job and fix the problem by reconstructing the missing data from parity and writing the data back to that bad sector.

So it's inevitable these bad sectors pop up here and there, and then if there's a single drive failure, in effect you get one or more full stripes with two or more missing strips, and now those whole stripes are lost just as if it were a 2-disk failure. It is possible to recover from this but it's really tedious and as far as I know there are no user space tools to make such recovery easy.

I wouldn't be surprised if lots of NAS's using Linux were configured this way, and the user didn't use recommended drives because, FU vendor those drives are expensive, etc.

Re:ZFS lands in Debian contrib by rincebrain on Saturday May 14, 2016 @05:56PM (#11698225)
Don't forget the part where many consumer drives won't let you play with the SCT ERC settings, and some of them just completely crap out on URE and won't come back.

(My personal favorite was when I discovered a certain model of "consumer" drives we had thousands of in production claimed to not support SCT ERC configuration, but if you patched smartctl to ignore the response to "do you support this", the drives would happily configure and honor it.)

Re:ZFS lands in Debian contrib by jamesblonde on Sunday May 15, 2016 @02:53AM (#11699813)
Most enterprise-class drives are just consumer drives packaged with a bit more software, buy I guess you know that.
Re:ZFS lands in Debian contrib by rincebrain on Sunday May 15, 2016 @03:53AM (#11699963)
Yeah, I was just entertained by how lazily the removal was implemented in the consumer drive FW.
Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @12:02PM (#11696688)
Follow the money who is selling the raid5 is dead story. The main worry is correlated failures if you have the Sam types.of drives in arrays and they reach their end of life.
Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @04:46PM (#11697962)
Note that all the manufacturers aren't actually saying the URE is X. They are saying it's less than X, it's a cap. Therefore it isn't a rate. The actual rate for two drives could be very different, maybe even more than an order of magnitude different, but so long as it's below the spec's cap for such errors, it's considered normal operation.

So yeah, I agree, the whole idea in some circles that you will get a URE every ~12TB of data read is obviously b.s. We don't know what the real world rate is because of that little less than sign that appears in all of these specs. We only know there won't be more errors than that, and not for a specific drive, but rather across a (virtual) sample size for that make/model of drive.

Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @04:34PM (#11697916)
For scaleable storage, get rid of conventional RAID for data. I'd like to see n-way (definable) copies of metadata, and single copies of data. On top is a cluster file system like GlusterFS. When a device dies, the file system merely rebuilds metadata, and then informs GlusterFS of the missing data due to the failed drive(s). And then the file system deletes the reference to all missing/damaged files from that missing drive.

No degraded state ever happens. This way Gluster knows not to even make requests from that brick. If the brick were raid56 and the cluster fs isn't aware, requests happen with degraded read/writes which suck performance wise.

Plus Gluster (or even Ceph for that matter) might use some logic and say, well that data doesn't even need to be replicated on that brick, it's better for the network/use loading if the new copy is on this other brick over here.

Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @07:02PM (#11698459)
Sounds like hdfs....
Re:ZFS lands in Debian contrib by poizan42 on Saturday May 14, 2016 @08:52AM (#11695872)
That should be exposed as an option so the user can choose whether they need performance or reliability.
Re:ZFS lands in Debian contrib by xioxox on Saturday May 14, 2016 @10:02AM (#11696161)
Have you tried btrfs on an md RAID device (for interest)? We've run it for a while, but we don't care too much about performance.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @10:20AM (#11696227)
That seems ill advised, one of the benefits of btrfs is it obviates the need for lvm and mdadm.

I guess in your case you have a more stable raid5/6 opportunity, but you're losing many of the raid benefits present in btrfs natively. I'd also imaging it could be slower or introduce IO issues others haven't tested. Though I really have no idea, never seen anyone do that before.

Re:ZFS lands in Debian contrib by xioxox on Saturday May 14, 2016 @01:51PM (#11697252)
It's been great for our use case - we've been using it for about 5 years like this. We use it for rsyncing data onto as a backup (not the only one!), making daily snapshots. md is more flexible than zfs's raid, but less flexible as native btrfs raid.
Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @11:07AM (#11696440)
No, but a lot of people on the btrfs mailing list recommend this due to the lack of stability for raid5/6 on btrfs.
Re:ZFS lands in Debian contrib by Dylan16807 on Saturday May 14, 2016 @02:16PM (#11697369)
And it does the reflink copies and on-demand deduplication with minimal overhead. ZFS handles snapshots fine but its deduplication can cripple speeds, even when reading. Maybe some day it'll get block pointer rewrite, but for now it can be a big problem, depending on the type of data you have.
Re:ZFS lands in Debian contrib by eatonphil on Saturday May 14, 2016 @07:07AM (#11695560)
btrfs is immature.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @08:49AM (#11695864)
btrfs is stable as of kernel 3.14 or so. The features in btrfs that are unstable at this point are raid56 (write hole on power failure risk), autodefrag (and mainly just with high transaction files like vm images and databases), and ext34/in place filesystem conversion.

We've been running btrfs in production since Ubuntu 14.04 with excellent results. The feature set vastly outweighs the few risks that remain.

Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @11:11AM (#11696456)
You forgot about how sensitive it is to low disk space. Don't go above 80% in production is what I've been told - that's a lot of wasted disk space.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @11:55AM (#11696657)
You are correct that btrfs and ZFS are sensitive to low disk space. This is also related to how cow filesystems function, they need that free space to commit writes and for snapshots because they, by nature, don't overwrite blocks.

See this for the ZFS example; http://serverfault.com/a/556892/79238

In both cases the exact amount of free space you desire is a mix of workload, fragmentation, and snapshots.

However, I disagree they waste a lot of space. I think both ZFS and btrfs more than make up for the overhead of free space commits through their space saving features. cp --reflink, block suballocation, compresssion, and efficient snapshots outweight the overhead, in my case. Your mileage may vary.

Re:ZFS lands in Debian contrib by cm3 on Saturday May 14, 2016 @12:03PM (#11696692)
So, isn't there a way to set aside a buffer space so that you don't run into ENOSPACE problems? Maybe like ext's 5% reserve.
Re:ZFS lands in Debian contrib by Elhana on Saturday May 14, 2016 @05:37PM (#11698144)
As I understand it in btrfs case there is two problems: 1) Metadata in btrfs can use lots of space, especially when you convert from ext4. It might happen that you have gigabytes of free space reserved for metadata, so it can not be used anymore. This can be solved with rebalancing, but that can take ages, which is actually one of the reasons zfs doesn't have bpr rewrite feature. 2) btrfs can have mixed raid levels and in that scenario calculating free space is tricky, but people still rely on common tools, that simply give some estimates in that case. Change the way it estimates free space and you'll have less clueless people complaining about fs running out of it, but more will say btrfs shows too little.
Re:ZFS lands in Debian contrib by cm3 on Saturday May 14, 2016 @08:51PM (#11698785)
FWIW, Hammer on DragonflyBSD can rebalance and dedup with little memory and doesn't take long, but details matter and the comparison may not be fair. What's rebalance in ZFS might be something much more trivial and less effective in Hammer, but I've deduped Hammer filesystems on machines with little memory compared to what ZFS requires for its data structures in memory.
Re:ZFS lands in Debian contrib by ryao on Sunday May 15, 2016 @12:33PM (#11701535)
ZFS' data desuplication requires very little memory. However, it will check every new record write under it with every other record write. The only way to do this in a performant way is to lean on cache. Without sufficient cache, you degrade to performing 3 random sequential IOs, which peforms terribly. The system will continue to run, but it would be slow.

As far as I know, there is no way to implement online deduplication with constant RAM usage without performing poorly as things scale or playing Schrödinger's cat with whether data that should deduplicate is subject to deduplication. Offline data deduplication might work, but it would be performance crippling ZFS' data integrity guarentees.

If HAMMER has online data deduplication that is performant with constant ram, they likely made a sacrifice elsewhere to get it. My guess is that it misses cases, such that while you would expect unique records to be written once, they can be written multiple times.

Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @03:37PM (#11697703)
I believe you're misunderstanding the problems that occur on a cow filesystem. In fact btrfs already has an overcommit disk buffer, and is already doing many ENOSPACE handling tricks.

Have a look; https://btrfs.wiki.kernel.org/index.php/ENOSPC

Reading more for my own interest it seams ZFS uses ZIL to help convert random writes to sequential, which helps with fragmentation under low space. I am curious if bcache, can operate similarly. In addition, I should also point out that this is less of an issue on SSD, due to the nature of how random reads/writes work there anyway (btrfs does a good job of being SSD aware).

Re:ZFS lands in Debian contrib by ryao on Sunday May 15, 2016 @01:13AM (#11699542)
The last I checked, ZFS had no open ENOSPC bugs. The trick that it uses is to reserve small amount of space. I forget if it is 1.6% or 3.3%, but whichever that is, it combined with other tricks is considered to be enough.

ENOSPC is a very different condition from lower performance. If you tested filesystem me at 90% full, you should find that all of them have lower performance than when they were empty. You might also find performance varies based on how you filled them.

Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @02:51PM (#11697520)
You're right that the free space overhead is workload dependent. However, compression is orthogonal to the FS and for us, in the Hadoop world, we win nothing with efficient snapshots or other features. The problem we have is estimating how much overhead is 'safe', so we are inherently conservative. The lost disk capacity a big deal on 1k+ hadoop clusters.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @03:31PM (#11697676)
I'm going to disagree with you re: compression. Compression at the FS layer brings a lot of benefits, and generally most workloads are IO constrained not CPU constrained. Compression at the FS improves IO at the expense of CPU.

Hadoop is a completely different workload, and maybe not something for ZFS or btrfs. Our Hadoop nodes are not raid, just JBOD ext4 disks. We have been conidering btrfs with nodatacow mount option and lz4 compression, however. We haven't decided if it's better to compress within Hadoop or at the fs layer yet. I would be curious on your findings.

Re:ZFS lands in Debian contrib by jamesblonde on Saturday May 14, 2016 @04:58PM (#11698011)
In Hadoop, people are mostly using formats like Parquet, Orc, an if not, compression libs like lzo or snappy. If you believe the Berkeley people (I don't, but the sheeple do), most Spark workloads are CPU bound not IO bound. But irrespective of that, if most of your data is in a columnar data storage format, there's no gain (only cost) in having your FS also try and compress it. JBOD is considered best practice for Hadoop. That's why we're looking at RAID0 and RAID5 - we're researchers :) Actually, MapR recommend using 3 disks in RAID0 as volumes.
Re:ZFS lands in Debian contrib by ryao on Sunday May 15, 2016 @01:23AM (#11699562)
btrfs does not support lz4 compression. Unless you meant lzo, which performs terribly on incompressible data, you will want to use ZFS for lz4.

Also, nodatacow is a hack. If you take a snapshot on btrfs with nodatacow, it must use CoW on each thing in the snapshot that is overwritten. Until then, what ever horrible performance nodatacow prevented will manifest temporarily. ZFS is designed to make things asynchronous as much as possible (with the exception of partial record writes to unaccredited records, which needs to be fixed), so it lacks an equivalent to nodatacow and does not need it.

Re:ZFS lands in Debian contrib by krondor on Sunday May 15, 2016 @11:41AM (#11701302)
Yes, apologies, I did mean lzo. zlib seemed perhaps too much on the CPU side of the IO/CPU calculation. I am excited to see how btrfs snappy and lz4 support compares when they are added, however.

To the point of lzo performance though, btrfs is a tad smart with compression, it tries to compress an initial 128KiB and if the compressed segment is not smaller than the uncompressed it adds it to a list of no compress files, and will not try compression on that file again (unless of course you force it).

This was for our Hadoop use case, comparing to ext4, so nodatacow would work because we have no desire of snapshots in that environment. It still seems like we're better of compressing within the Hadoop framework (as jamesblonde is doing) and sticking with ext4 jbod, for now at least.

Re:ZFS lands in Debian contrib by ryao on Sunday May 15, 2016 @09:14PM (#11703649)
Btrfs will likely never add support for lz4 or snappy:

https://btrfs.wiki.kernel.org/index.php/Compression#Are_ther...

There are links there to mailing list emails explaining the reasoning behind that. The reasoning behind ZFS adopting LZ4 can be found here:

http://wiki.illumos.org/display/illumos/LZ4+Compression

Contrary to what the btrfs developers claimed about LZ4 versus LZJB in ZFS, LZ4's compression performance on incompressible data alone would have been enough to adopt it had ZFS already had LZO support. LZ4 also has the benefit of extremely quick decompression speeds. It also has the peculiar property where running LZ4 repeatedly on low entropy files outperforms "superior" compression algorithms such as gzip. Someone on the LZ4 mailing list discovered this when compressing log files. He compressed a 3.5GB log file into a ~750KB file by running LZ4HC 5 times. Running it twice yielded a 9.5MB file with regular LZ4 compression and a 2MB file with LZ4HC compression. He was able to compress it to ~750KB after running LZ4HC roughly 5 times.

https://groups.google.com/forum/#!topic/lz4c/DcN5SgFywwk

As for btrfs being smart with lzo by compressing only the first 128KB as a heuristic, LZ4 uses a hash table for that and is able to give up much faster. I would expect to see LZ4 significantly outperform LZO. The following site has numbers that appear to confirm that:

https://quixdb.github.io/squash-benchmark/

On a JPEG on their Intel® Core i7-2630QM, LZ4 level 1 compression runs at 608.24MB/sec while LZO level3 compression runs at 68.13MB/sec. Also of possible interest is that Snappy compresses at 559MB/s here. There are a couple caveats though. While I picked the correct variant of LZ4 for ZFS (and also the Linux kernel), I assumed that btrfs is using the default compression level on LZO like ZFS does on LZ4 and knew nothing about the different revisions measured, so I took the best reported number for any of them at the default compression level. That happened to be lzo1b. I also assumed that JPEGs are incompressible, which the data strongly supports. There are a several exceptions, but LZO, Snappy and LZ4 all consider the file to be incompressible.

As for the question of whether to compress in hadoop or in the filesystem, the properties of LZ4 mean that you can do both. If your data is incompressible, LZ4 will give up very quickly (both times). If your data is incompressible after 1 round of LZ4 compression, then the LZ4 compression in ZFS will give up quickly. If it is compressible by two rounds of LZ4, then both will run and you will use less storage space because of it.

Re:ZFS lands in Debian contrib by krondor on Wednesday May 18, 2016 @03:19PM (#11724936)
Thank you, this was a great reply. Reading the discussions have been interesting.
Re:ZFS lands in Debian contrib by cmurf on Saturday May 14, 2016 @05:25PM (#11698103)
I haven't heard this and I've been on the btrfs list for years. The biggest issue you're going to have at 80+% usage, that applies to all file systems getting slow, is transfer rate drops due to inner tracks having fewer sectors; and depending on the workload, seeks are increasing simply because there's more stuff on the disk to go looking for.

As for fragmentation there are two kinds: fragmentation of files into more than one extent, fixed with 'btrfs filesystem defrag' and also autodefrag. And the other is fragmentation of free space, as a result of deleting files and that's fixed with 'btrfs balance' which consolidates extents and writes them into new chunks then frees up large regions of contiguous space on the drives. This is best used with filters.

Re:ZFS lands in Debian contrib by XorNot on Saturday May 14, 2016 @09:19AM (#11695983)
The problem is "in production" you can do a lot of things which ironically don't work for smaller users, because "in production" you specifically optimize and assume hardware and applications will crash in catastrophic ways pretty much all the time and you code quite differently (i.e. it is totally reasonable to ask applications to be distributed and deal with it).
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @09:47AM (#11696095)
Agreed, my workload is probably not representative of a small organization or user. I absolutely leverage resiliency in software, distributed computing, and mitigate single points of failure, etc... This is a good point.

Now, I do think these methods are increasingly approachable for all users, however. A lot of that is actually enabled by the feature sets of ZFS and btrfs. The default Ubuntu installer, for example, will create snapshots during OS upgrade for rollback if the upgrade fails. ZFS and btrfs send/receive feature allows for efficient DR clones (not to mention seed images and snapshots). LXD leverages ZFS if you choose to for rapid containerization and snapshots.

These intrinsic abilities of these two filesystems allow for smaller users and organizations to improve those workflows to be more risk averse in general (even while assuming some risk in a newer FS).

Just, if possible, be up to date on the known issues and run more recent kernels and userland utilities.

https://btrfs.wiki.kernel.org/index.php/Gotchas

Re:ZFS lands in Debian contrib by DominoTree on Saturday May 14, 2016 @09:05AM (#11695930)
"stable" != "mature"
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @09:11AM (#11695945)
That's a fair point. I guess we can debate what 'mature' means.

In development since 2007, stable since 2014. ZFS, in development since 2001 (correction I erroneously listed 2005 earlier), stable since 2006 (or at least Solaris included since then). Do you consider the Solaris years or just the Linux years and then do you consider the Linux Debian/Ubuntu sanctioned years or the ZoL years?

I'm fine with mature since included in the default installer on Ubuntu/Redhat/Oracle/SUSE/etc... for my definition of btrfs maturity.

Re:ZFS lands in Debian contrib by eatonphil on Saturday May 14, 2016 @09:34AM (#11696034)
I think you've confused your dates. ZFS has been in development since 2001. It was first introduced in 2005.
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @09:53AM (#11696122)
Yes, thanks for catching that, I've edited the parent.

As you can tell I'm not that strong on ZFS other than what I've learned in some small tinkering and discussion with others.

Re:ZFS lands in Debian contrib by bogomipz on Saturday May 14, 2016 @09:56AM (#11696138)
It seems odd that after all this time that btrfs wouldn't be able to handle database workloads. If it can't handle hight I/O it doens't have much use except for a bootdisk. Do you have any reading you could suggest on this issue?
Re:ZFS lands in Debian contrib by krondor on Saturday May 14, 2016 @10:29AM (#11696258)
As zanny said, cow presents an issue for transactional workloads (databases, vm images, etc...) as each write fragments the file, by nature of the process of cow.

btrfs can handle database workloads but you have to disable cow for them (which you can do at the file, directory, or subvolume level in btrfs). You would specify the nodatacow mount option, or chattr +C (file/directory).

The btrfs autodefrag is still rather new, and needs some work. I expect that could be the long term fix (manual defrag is fine now, but you wouldn't want to call it frequently on a db file), I'm not sure how ZFS handles the fragmentation, but I do know in the past ZFS observed similar issues (seems to have been mostly resolved). I should also point out that disabling cow doesn't really fully disable it, snapshots can still function, etc... however, I'm sure that once you start to use the other cow functions you might observe slipping performance due to fragmentation of these types of files.

https://blog.pgaddict.com/posts/friends-dont-let-friends-use... https://bartsjerps.wordpress.com/2013/02/26/zfs-ora-database...

Re:ZFS lands in Debian contrib by zanny on Saturday May 14, 2016 @10:03AM (#11696167)
btrfs is only particularly slow on database files if they are not marked for inplace writing because the filesystem is default copy on write, which is horribly slow for huge constantly changing files (they end up highly fragmented across data blocks if you don't turn off cow).
Re:ZFS lands in Debian contrib by EyesBlue1988 on Saturday May 14, 2016 @12:09PM (#11696725)
btrfs is not stable!, xfs is stable
Re:ZFS lands in Debian contrib by zanny on Saturday May 14, 2016 @10:06AM (#11696179)
ext4 = started in 2006, stable in 2008, universal on all distros by 2010 btrfs = started in 2007, stable in 2014, mature never?

There is no magical point in time where a file system is suddenly "mature". If anything I'd argue once OpenSUSE started defaulting to it one should consider it stable. I just wonder why Ubuntu / Fedora are not prioritizing making it default since snapshotted upgrades are such a huge usability gain and are trivially easy with btrfs.

Re:ZFS lands in Debian contrib by eatonphil on Saturday May 14, 2016 @11:06AM (#11696432)
Meanwhile, just for reference, ZFS started in 2001. Introduced in Solaris in 2005 and FreeBSD in 2007.

I'm not necessarily trying to make a point here, just adding some related facts.

Re:ZFS lands in Debian contrib by rcthompson on Saturday May 14, 2016 @02:58PM (#11697553)
I don't know if it's fair to say that ext4 "started" in 2006, given that it was an evolution of ext3, which was an evolution of ext2 (which I assume was an evolution of ext?), to the point that you can still mount an ext2 filesystem as a very feature-limited ext4 filesystem.
Re:ZFS lands in Debian contrib by _asummers on Saturday May 14, 2016 @10:35AM (#11696272)
Why the 7 year gap for stabilization? Especially after ext4 only took 2. Jusding from the timelines, btrfs is much more complicated and I'd guess more Linux users exposed more corner cases, but a 3.5x lengthening is substantial.
Re:ZFS lands in Debian contrib by lallysingh on Saturday May 14, 2016 @10:53AM (#11696354)
AFAICT, btrfs is a while new system, while ext4 is a set of changes to an already tested coffee base.
Re:ZFS lands in Debian contrib by lallysingh on Saturday May 14, 2016 @01:22PM (#11697114)
*code base. Friggin' autocomplete.
Re:ZFS lands in Debian contrib by cm3 on Saturday May 14, 2016 @12:05PM (#11696700)
ext4 isn't a rewrite and magnitudes smaller in code size and complexity, so the comparison isn't really fair.
Re:ZFS lands in Debian contrib by zxcvcxz on Saturday May 14, 2016 @01:00PM (#11697008)
It's the default file system in OpenSUSE.
Re:ZFS lands in Debian contrib by leonroy on Saturday May 14, 2016 @05:46PM (#11698181)
BTRFS has much lower memory requirements than ZFS which needs at least 16GB RAM for anything performant. Also for NAS boxes expecting the user to compile the ZFS libs from source wouldn't be optimal.
Re:ZFS lands in Debian contrib by ThatPlayer on Saturday May 14, 2016 @07:14AM (#11695582)
Btrfs is a different use-case.

ZFS doesn't support different sized hard drives. I could also be wrong, but ZFS doesn't expand as easily, and you can't remove drives from it.

Synology NAS just added support for Btrfs in their software

Re:ZFS lands in Debian contrib by stewartbutler on Saturday May 14, 2016 @07:28AM (#11695628)
ZFS does support different sized drives, and you can add disks to a pool easily.

It does not support different sized drives in a raidz (equivalent to an mdadm array), as far as I know, but you can mix raidz and singular drives in a pool, though that is a bit silly. It also does not support adding disks to a raidz, which is equivalent to growing a raid5 or raid6 array, which is admittedly a pain in the ass.

Re:ZFS lands in Debian contrib by mbreese on Saturday May 14, 2016 @09:40AM (#11696065)
You can also upgrade an entire raidz vdev if you replace each drive in the vdev with a larger one (one at a time) and enable "autoexpand" on the zpool. It's a manual and time consuming process, waiting for each drive to resilver. Still an pain, but at least possible.
Re:ZFS lands in Debian contrib by Annatar on Sunday May 15, 2016 @05:51AM (#11700192)
> It does not support different sized drives in a raidz

  % mkfile -v 64m /var/tmp/d0
  /var/tmp/d0 67108864 bytes
  % mkfile -v 96m /var/tmp/d1
  /var/tmp/d1 100663296 bytes
  % mkfile -v 128m /var/tmp/d2
  /var/tmp/d2 134217728 bytes
  % sudo zpool create -f pool0 raidz /var/tmp/d0 /var/tmp/d1 /var/tmp/d2
  Password:
  % zpool status
    pool: pool0
   state: ONLINE
    scan: none requested
  config:

        NAME             STATE     READ WRITE CKSUM
        pool0            ONLINE       0     0     0
          raidz1-0       ONLINE       0     0     0
            /var/tmp/d0  ONLINE       0     0     0
            /var/tmp/d1  ONLINE       0     0     0
            /var/tmp/d2  ONLINE       0     0     0

  errors: No known data errors
Re:ZFS lands in Debian contrib by stewartbutler on Tuesday May 17, 2016 @09:20PM (#11719029)
You can build it, but it is limited to the smallest device in the vdev, so the array will appear to only have three devices of 64m available. Though you can replace all smaller disks and grow it.
Re:ZFS lands in Debian contrib by Annatar on Wednesday May 18, 2016 @05:20AM (#11720692)
That is not how RAIDZ works. Because every write is a dynamic width stripe, the capacity is an aggregate minus parity, not linear.

The smallest device capacity applies to RAID1+0, which is mirroring, but it does not apply to RAIDZ.

Re:ZFS lands in Debian contrib by 4ad on Saturday May 14, 2016 @07:44AM (#11695671)
Of course that ZFS supports any sized drives in a pool. ZFS expands very easily, in fact, the user doesn't have to do anything, it automatically expands.

Of course you can remove drives in ZFS. How else could you replace disks?

I downvoted your post because every statement you made about ZFS is wrong.

Re:ZFS lands in Debian contrib by wtallis on Saturday May 14, 2016 @08:10AM (#11695745)
You're describing operations that can be done on a pool, while conveniently ignoring that they can not be done to a single RAID array (vdev), which is the more useful comparison against btrfs.

Yes, you can add drives of arbitrary size to a ZFS pool, but when put into the same array, they all get treated as the size of the smallest one. Yes, you can expand a ZFS pool but only by adding a new array or by incrementally upgrading all the drives in the new array. Yes, you can remove drives, but only for replacement purposes; you can't do an in-place rebuild to make the reduced number of drives the new normal instead of degraded mode.

Re:ZFS lands in Debian contrib by simoncion on Saturday May 14, 2016 @08:21AM (#11695777)
I know nothing about ZFS, so sorry if these are dumb questions.

Can you have an array that contains a single disk? And if you can, then

* Can you add as many single drive arrays to a pool as you like?

* Can you migrate data off of a given single-drive array on to other single-drive arrays in the pool and then permanently remove the array from the pool?

Re:ZFS lands in Debian contrib by lmz on Saturday May 14, 2016 @08:27AM (#11695794)
Yes, yes, no. Plus a single disk array has no redundancy.
Re:ZFS lands in Debian contrib by X86BSD on Sunday May 15, 2016 @09:15AM (#11700783)
Minor nit: depending on your definition of redundancy, you may set copies=n, on a single vdev pool. You won't get hardware redundancy but will get data redundancy.