Cached and uncached files

A readdir operation on a directory populates the metadata of the directory in the cache, but this operation does not populate contents of each file within the directory. A read operation on file generates a request to the home to make contents available in the cache. The file contents do not need to be in the cache to start reading it.

AFM allows data to be pre-populated before actual read operation by using the mmafmctl prefetch command. For more information about pre-populating data, see Prefetch.

A file whose contents are available in the cache is called a cached file. A file whose contents are not yet present in the cache is called an uncached file. An uncached file cannot be evicted, resynched with home, or failed over to a new home. See the sections on Asynchronous operations and delay, for AFM eviction and syncing to home.

Files that have all blocks read, or the entire file contents that is fetched, are marked as cached. AFM does whole file caching by default. By default, reading more than three blocks of a file drives AFM to cache the full file in the background for performance. Sometimes, the whole file might not need to be cached. For example, some applications read only a few bytes of a file to detect the file mime type. In such cases, you can configure partial file read behavior on cache fileset. For more information about partial file caching, see Partial file caching.

When a write operation is performed directly on an uncached file in IW, SW, or LU modes, AFM fetches first the entire file to the cache (cached) by default and later allows the local write to proceed. This behavior is for in place writes within the size of the file. If the append that is being performed to the file is more than the last offset, the behavior is slightly different:
  • The append on files in IW or SW filesets appends only data to the file at the cache. This append can leave the rest of the file data from the home as uncached.
  • The append on files in the LU mode must mark the file as dirty, and the append disconnects the appended file with an appended file of the cache. So that AFM fetches the entire file even for an append more than the file size.
Likewise, the files that originate in the cache on IW, SW, or LU filesets are marked as cached by default because these files are created and written to at the cache.