FreeNAS says I lose data if I remove my SLOG?

Status
Not open for further replies.

DaveY

Contributor
Joined
Dec 1, 2014
Messages
141
Can someone clarify the statement in FreeNAS documentation about losing data when removing a log device?

8.1.10.2. Removing a Log or Cache Device
Removing or replacing the log device will lose any data in the device which had not yet been written. This is typically the last few seconds of writes.

From what I understand, SLOG data is not used unless you need to recover from a power lose or a hard reset so you don't REALLY lose last few seconds of writes as FreeNAS suggests, do you? Seems silly to not be able to remove a SLOG without losing data, but want to make sure I understand what I'm reading.
 
Last edited:

ethereal

Guru
Joined
Sep 10, 2012
Messages
762

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
If you remove your SLOG, and your server simultaneously crashes, you will lose all the data on the SLOG, which is data that should have been written safely but wasn't.

I would recommend shutting down your FreeNAS server to remove your SLOG. On clean shutdown, ZFS will process all pending writes, which means all data that is written to the SLOG will be properly written to disk. Then, you don't have any problems.
 

DaveY

Contributor
Joined
Dec 1, 2014
Messages
141
If you remove your SLOG, and your server simultaneously crashes, you will lose all the data on the SLOG, which is data that should have been written safely but wasn't.

I would recommend shutting down your FreeNAS server to remove your SLOG. On clean shutdown, ZFS will process all pending writes, which means all data that is written to the SLOG will be properly written to disk. Then, you don't have any problems.

Thanks Nick2253. That is my original understanding as well until I read the FreeNAS documentation. I guess my point is the way the documentation is written, it seems to suggest that regardless of whether there's a crash or not, replacing or removing SLOG "WILL" cause data loss. Perhaps the documentation needs to be worded better to avoid the already confusing topic of ZIL and SLOGs for people new to FreeNAS. It certainly doesn't help the very next line in the documentation says,

Code:
Removing or replacing a cache device will not result in any data loss, but may have an impact on read performance until the device is replaced.


again, suggesting that removing a log device causes data loss while removing a cache device (L2ARC) does not result in data loss.
 

rs225

Guru
Joined
Jun 28, 2014
Messages
878
I think the best way to remove a SLOG is with the pool online. That way, ZFS is informed ahead of time and can switch to using a ZIL on the pool.

It is an assumption that ZFS shuts down by flushing the SLOG to the rest of the VDEVs. Since earlier versions of ZFS did not allow importation with the SLOG missing at all, I think this assumption is possibly wrong.

In the situation where this assumption is false (e.g. a crash), and the SLOG is then removed, then the data loss possibility can occur.
 

Mirfster

Doesn't know what he's talking about
Joined
Oct 2, 2015
Messages
3,215

Nick2253

Wizard
Joined
Apr 21, 2014
Messages
1,633
There's nothing strictly inaccurate about what the documentation says, though I do agree that it probably needs to be rewritten for clarity.

I think the best way to remove a SLOG is with the pool online. That way, ZFS is informed ahead of time and can switch to using a ZIL on the pool.
After doing some more research on this, I agree with you. Older versions of ZFS did not release a SLOG very cleanly; even after v15, you still had some problems. Shutting down the system was a reliable way to clear the write cache. With newer versions of ZFS, it looks like this problem went away, and the data is properly flushed from the write cache when the SLOG is disconnected.
 

DaveY

Contributor
Joined
Dec 1, 2014
Messages
141
How do we get the documentation updated? Looks like the verbiage about data loss is still referring to an older version of ZFS where data is not properly flushed when a SLOG is replaced or removed with the system online.

Thanks for the confirmation though that it's indeed safe to remove slogs online without any issues.
 
Status
Not open for further replies.
Top