ZFS: How to enable cache and logs.

Jeremy Chadwick freebsd at jdc.parodius.com
Thu May 12 09:05:51 UTC 2011


On Thu, May 12, 2011 at 10:45:01AM +0200, ?imun Mikecin wrote:
> On 12. svi. 2011., at 10:34, Jeremy Chadwick wrote:
> > 
> > I had no idea the primary point of a SLOG was to deal with applications
> > that make use of O_SYNC.  I thought it was supposed to improve write
> > performance for both asynchronous and synchronous writes.  Obviously I'm
> > wrong here.
> 
> If the application is not using O_SYNC, write operation returns to the
> app before the data is actually written.

Yes, I understand that -- O_SYNC is effectively the same as issuing
fsync(2) after every write(2) call.  I just thought that the ZIL
improved both synchronous and asynchronous writes, but my understanding
of the ZIL is obviously very limited.

> > What guarantee is there that the intent log -- which is written to the
> > disk -- actually got written to the disk in the middle of a power
> > failure?  There's a lot of focus there on the idea that "the intent log
> > will fix everything, but may lose writes", but what guarantee do I have
> > that the intent log isn't corrupt or botched during a power failure?
> 
> I expect that checksumming also works for ZIL (anybody knows?). If
> that is the case, corruption would be detected, but you will have lost
> data unless you are using mirrored slog devices.

I can't believe that statement either (the last line).

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.

-- 
| Jeremy Chadwick                                   jdc at parodius.com |
| Parodius Networking                       http://www.parodius.com/ |
| UNIX Systems Administrator                  Mountain View, CA, USA |
| Making life hard for others since 1977.               PGP 4BD6C0CB |



More information about the freebsd-fs mailing list