ZFS: How to enable cache and logs.

Gary Palmer gpalmer at freebsd.org
Thu May 12 18:05:59 UTC 2011


On Thu, May 12, 2011 at 02:05:24AM -0700, Jeremy Chadwick wrote:
> I guess that's also what I'm asking here -- what guarantee do you have
> that even with a mirrored 2-disk SLOG (or heck, 3 or 4!) that *no data*
> will be *lost* during a power outage?
> 
> It seems to me the proper phrase would be "the likelihood of losing an
> entire pool during a power outage is lessened".  Alexander indirectly
> hinted at this in another post of his tonight, specifically regarding
> zpool v15 versus v28:
> 
> "The difference between v15 and v28 is the amount of data you lose (the
> entire pool vs. only what is still on the log devices)".
> 
> This makes much more sense to me.
> 
> It seems that in a power outage, there will always be some form of data
> loss.  I imagine even systems that have hardware RAM/cache with BBUs on
> everything; there's always some form of caching going on *somewhere*
> within a system, from CPU all the way up, that guarantees some degree of
> data loss).  I guess I'm OCD'ing over the terminology here.  Sorry.

At one level, nothing you can do in hardware can protect you from data
loss or corruption due to a power outage.  This is why applications and
protocols must be designed with that in mind. E.g. RFC 821/2821/5321
explicitly state that a MTA cannot acknowledge the <CR><LF>.<CR><LF> at
the end of the DATA segment until the message is committed to permanent
storage.  That can lead to message duplication, but thats better than the
alternative - the message is always queued *somewhere*. (And yes, there are/
were vendors who "accidentally" overlook that requirement in the name of
increased throughput)

Trying to solve this entirely in hardware is pointless.  You need to look
at the entire system end-to-end to eliminate data loss problems.

Regards,

Gary


More information about the freebsd-fs mailing list