power outage effect on ZFS

Status
Not open for further replies.

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
Hi all,

This is my second post on the forum. Preparing to build a FreeNAS appliance (had another thread about HW choices and this is clear) and I have a question:
Because I have less experience of ZFS I'm wondering what happens if it suffers from a power outage? I intend to use 32GB ECC - This amount of ram will be filled with data/metadata correct? Supposing we have a process working...like copy/download.
If FreeNAS will not boot....well I guess fsck -t ufs -y /dev/* will fix it.
What about mounting the zpool? Can it be affected? If yes how can it be prevented (i know: ups...not an option) is there anything else @ the software level I can do?

thank you
 
Last edited:

Pitfrr

Wizard
Joined
Feb 10, 2014
Messages
1,531
Hello,

I dont have the theory but I can give you some of my experience regarding power outage.

I did some tests with my test set-up to see how FreeNAS (9.1.2.8, some old version I didn't try with the 9.10).
The tests consisted in unplugging the system while it was running (idle, read, write and scrub) and performing a scrub afterwards to check the health of the data.
I was surprised but didn't have any error. I could boot without problem each time, the scrubs performed without errors.

And in the end I did put an UPS on the system! ;-P
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
As a DR scenario, this is ok...power outages do not call before :)
concern is not only mounting the system (FreeNAS os) this can dies million times. I can keep bkp's on usb's or watever. zpool concerns me by loosing the all ram volatile date there.
 

melloa

Wizard
Joined
May 22, 2016
Messages
1,749
zpool concerns me by loosing the all ram volatile date there.

You got the point. That's why UPS is so important, specially in a scenario where you will have several users creating/changing data on your server.
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
You got the point. That's why UPS is so important, specially in a scenario where you will have several users creating/changing data on your server.
that's the problem. I can't have it now in the setup. is there any possibility to limit the damage?
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
It's no different than a system running some other filesystem and zfs's behavior is better. Really your question is just about writing data. This happens in a transaction so data and metadata are never out of sync. In a ufs system these things can become out of sync and that is why you need fsck. Fsck doesn't fix the lost data it just cleans up the filesystem so it can work correctly. At the most with zfs you lose a transaction group which is like 5sec or a certain size, I can't remember the specifics but you can look them up. You should never have data corruption like you would with ufs. But you can have data that isn't written to disk get lost which makes total sense.

Using things like NFS with sync enabled will force all data sent by the client to always be written to disk before acknowledge to the client. This affects performer depending on your workload.

What is your workflow and hardware? Why are you being so strict about a power loss, most people don't worry about it and just get a ups.
Sent from my Nexus 5X using Tapatalk
 

Ericloewe

Server Wrangler
Moderator
Joined
Feb 15, 2014
Messages
20,194
well I guess fsck -t ufs -y /dev/* will fix it.
No, that will most certainly not fix anything at all. All partitions are either swap, FAT or ZFS.
Supposing we have a process working...like copy/download.
Depends on what you're doing. Most likely, you lose the last few seconds of data transferred - unless you're using sync writes. What that means will depend on the protocol being used.
What about mounting the zpool? Can it be affected?
Yes, you may have to delete the last few transactions that did not complete properly.
If yes how can it be prevented (i know: ups...not an option) is there anything else @ the software level I can do?
You could use 100% sync writes, but you'd end up buying a UPS instead.
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
This affects performer depending on your workload.
What is your workflow and hardware? Why are you being so strict about a power loss, most people don't worry about it and just get a ups.
system will be supermicro + e3-1230or1270 v5, 32GB ECC, 4x4 TB red wd + 4x2TB green old Seagate.
workload: home nas, plex, photos and bkps / ISCSI to VMware/OpenStack servers.

P. S didn't know that data will be synced every 5 seconds. Can this value be altered? It would impact performance I know, it yes it might be adjusted to each specific requirements. Thinking of zils/l2arc as an additional layer between ram & HDD but I think is not the case.
 
Last edited:

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
system will be supermicro + e3-1230or1270 v5, 32GB ECC, 4x4 TB red wd + 4x2TB green old Seagate.
workload: home nas, plex, photos and bkps / ISCSI to VMware/OpenStack servers.

P. S didn't know that data will be synced every 5 seconds. Can this value be altered? It would impact performance I know, it yes it might be adjusted to each specific requirements. Thinking of zils/l2arc as an additional layer between ram & HDD but I think is not the case.
You are way over thinking this. You should not care about a power outage with that workflow.

Sent from my Nexus 5X using Tapatalk
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
I see. Well I always try to thing about all scenarios. + I try to understand exactly how zfs works & behaves.
 

SweetAndLow

Sweet'NASty
Joined
Nov 6, 2013
Messages
6,421
Google zfs transactions and copy on write

Sent from my Nexus 5X using Tapatalk
 

nikkon

Contributor
Joined
Dec 16, 2012
Messages
171
all clear. thank you.
 
Status
Not open for further replies.
Top