GFS2 - Differences From A Local Filesystem

Differences From A Local Filesystem

Although the designers of GFS/GFS2 aimed to emulate a local filesystem closely, there are a number of differences to be aware of. Some of these are due to the existing filesystem interfaces not allowing the passing of information relating to the cluster. Some stem from the difficulty of implementing those features efficiently in a clustered manner. For example:

  • The flock system call on GFS/GFS2 is not interruptible by signals.
  • The fcntl F_GETLK system call returns a PID of any blocking lock. Since this is a cluster filesystem, that PID might refer to a process on any of the nodes which have the filesystem mounted. Since the purpose of this interface is to allow a signal to be sent to the blocking process, this is no longer possible.
  • Leases are not supported with the lock_dlm (cluster) lock module, but they are supported when used as a local filesystem
  • dnotify will work on a "same node" basis, but its use with GFS/GFS2 is not recommended
  • inotify will also work on a "same node" basis, and is also not recommended (but it may become supported in the future)
  • splice is supported on GFS2 only

The other main difference, and one that is shared by all similar cluster filesystems, is that the cache control mechanism, known as glocks (pronounced Gee-locks) for GFS/GFS2, has an effect across the whole cluster. Each inode on the filesystem has two glocks associated with it. One (called the iopen glock) keeps track of which processes have the inode open. The other (the inode glock) controls the cache relating to that inode. A glock has four states, UN (unlocked), SH (shared - a read lock), DF (deferred - a read lock incompatible with SH) and EX (exclusive). Each of the four modes maps directly to a DLM lock mode.

When in EX mode, an inode is allowed to cache data and metadata (which might be "dirty", i.e. waiting for write back to the filesystem). In SH mode, the inode can cache data and metadata, but it must not be dirty. In DF mode, the inode is allowed to cache metadata only, and again it must not be dirty. The DF mode is used only for direct I/O. In UN mode, the inode must not cache any metadata.

In order that operations which change an inode's data or metadata do not interfere with each other, an EX lock is used. This means that certain operations, such as create/unlink of files from the same directory and writes to the same file should be, in general, restricted to one node in the cluster. Of course, doing these operations from multiple nodes will work as expected, but due to the requirement to flush caches frequently, it will not be very efficient.

The single most frequently asked question about GFS/GFS2 performance is why the performance can be poor with email servers. The solution is to break up the mail spool into separate directories and to try to keep (so far as is possible) each node reading and writing to a private set of directories.

Read more about this topic:  GFS2

Famous quotes containing the words differences and/or local:

    No sooner had I glanced at this letter, than I concluded it to be that of which I was in search. To be sure, it was, to all appearance, radically different from the one of which the Prefect had read us so minute a description.... But, then, the radicalness of these differences ... these things ... were strongly corroborative of suspicion.
    Edgar Allan Poe (1809–1849)

    Civility, which is a disposition to accommodate and oblige others, is essentially the same in every country; but good breeding, as it is called, which is the manner of exerting that disposition, is different in almost every country, and merely local; and every man of sense imitates and conforms to that local good breeding of the place which he is at.
    Philip Dormer Stanhope, 4th Earl Chesterfield (1694–1773)