Re: Intent logging (journalling)

From: Stephen M. Dunn (stephen_at_stevedunn.ca)
Date: 01/29/04


Date: Thu, 29 Jan 2004 21:13:06 GMT

In article <bvavjl$p39t8$1@ID-142465.news.uni-berlin.de> Stuart Marshall <stuart@spidersoft.co.uk> writes:
$What actual advantage to this offer, is turning it off a bad idea? My
$initial thoughts are, yes - it's a bad idea, but I'll be honest and
$say I don't exactly know why.

   Logging writes the metadata changes (not the actual file data, but
the information the OS uses to keep track of the file - the type of
stuff you find in the inode) to a log file before making the changes.
After the changes are made, another market is written to the logfile
to indicate that the changes have been written to disk.

   Without logging, fsck has to look at all of the metadata, and
ensure that it is all consistent, so even if you were only writing
to one file when the system crashed, fsck has to check everything.
This can take many seconds or minutes, particularly on large
filesystems.

   With logging, fsck can look at the log and see if there were
any changes that were logged but not marked complete. If so, it
simply completes them; the log contains all of the information needed
to replay the changes. This is a heck of a lot faster than the
old way, as the time required depends only on the volume of changes
that were in progress at the time the system crashed and not on
the size of the filesystem.

   Note that we're talking about metadata only. The actual file
data is not affected by whether or not you use intent logging;
it is still written asynchronously according to the kernel parameters
you've set for flushing the buffer cache (or it can be written
synchronously if the application requests this by means such as
fsync()).

   In theory, at least, turning logging off should not help a
data corruption issue, unless you have some weird hardware issue
that is triggered by the extra writes for logging - and in that
case, it's not logging that's at the root of the problem. Neither
should it hurt to turn off logging, if you're prepared to accept
the need to run a full fsck should the system go down uncleanly.

   In general - and I don't recall whether this applies specifically
to OSR5's HTFS or not - journalling can improve performance in some
cases. Without it, metadata changes are often written synchronously,
to improve reliability, but this means that the read/write heads have
to hit several places (e.g. superblock, inodes, directory entries)
which can require some amount of seeking. With journalling, metadata
changes are first written to the log, which doesn't require changes
to be written in multiple places so it's quicker; since the required
changes are now logged, the metadata can then be written asynchronously.
As I said, I don't recall whether the OSR5 implementation works this
way, so unless someone comes up with an authoritative answer, don't
assume that this is applicable.

-- 
Stephen M. Dunn                             <stephen@stevedunn.ca>
>>>----------------> http://www.stevedunn.ca/ <----------------<<<
------------------------------------------------------------------
     Say hi to my cat -- http://www.stevedunn.ca/photos/toby/


Relevant Pages

  • Re: Ultra 10 vs Sunblade 150 - power cut
    ... turning on logging in vfstab for local ... > mounts eliminated the need for fsck on every machine I tried. ...
    (comp.unix.solaris)
  • Re: Ultra 10 vs Sunblade 150 - power cut
    ... turning on logging in vfstab for local ... > mounts eliminated the need for fsck on every machine I tried. ... use UFS logging, especially with the imporovments in the latest S9 ...
    (comp.unix.solaris)
  • Re: IIS7 - 67GB of Log Files
    ... What types of functions are handled through IIS? ... is internet exposed, if not, then I'd look at turning logging off. ... 67 GB worth of logs, your site must be pretty busy. ... If you are not using the data, you can also just turn off logging by ...
    (microsoft.public.inetserver.iis)
  • Re: Autofsck after a crash!
    ... > the whole point of logging file systems was to avoid running fsck, ... no fsck full pass is done. ... using logging since it was bundled with the OS in Solaris 7, ...
    (comp.unix.solaris)
  • Re: The server failed to complete 78.000000. print jobs.
    ... all the way to logging every detail of what the printer's doing. ... That, plus seeing the problem at more than one location, ... > I'd suggest turning that off to see if it makes the log events stop. ...
    (microsoft.public.windows.server.sbs)