Forcing the Update of Cached Data

AFS's callback mechanism normally guarantees that the Cache Manager provides the most current version of a file or directory to the application programs running on its machine. However, you can force the Cache Manager to discard (flush) cached data so that the next time an application program requests it, the Cache Manager fetches the latest version available at the File Server.

You can control how many file system elements to flush at a time:

In addition to callbacks, the Cache Manager has a mechanism for tracking other kinds of possible changes, such as changes in a volume's location. If a volume moves and the Cache Manager has not accessed any data in it for a long time, the Cache Manager's volume location record can be wrong. To resynchronize it, use the fs checkvolumes command. When you issue the command, the Cache Manager creates a new table of mappings between volume names, ID numbers, and locations. This forces the Cache Manager to reference newly relocated and renamed volumes before it can provide data from them.

It is also possible for information about mount points to become corrupted in the cache. Symptoms of a corrupted mount point included garbled output from the fs lsmount command, and failed attempts to change directory to or list the contents of a mount point. Use the fs flushmount command to discard a corrupted mount point. The Cache Manager must refetch the mount point the next time it crosses it in a pathname. (The Cache Manager periodically refreshes cached mount points, but the only other way to discard them immediately is to reinitialize the Cache Manager by rebooting the machine.

To flush certain files or directories

  1. Issue the fs flush command.

       % fs flush [<dir/file path>+]
    

    where

    flush

    Must be typed in full.

    dir/file path

    Names each file or directory structure to flush from the cache. Omit this argument to flush the current working directory. Flushing a directory structure does not flush any files or subdirectories cached from it.

To flush all data from a volume

  1. Issue the fs flushvolume command.

      % fs flushvolume [<dir/file path>+]
    

    where

    flushv

    Is the shortest acceptable abbreviation of flushvolume.

    dir/file path

    Names a file or directory from each volume to flush from the cache. The Cache Manager flushes everything in the cache that it has fetched from the same volume. Omit this argument to flush all cached data fetched from the volume that contains the current working directory.

To force the Cache Manager to notice other volume changes

  1. Issue the fs checkvolumes command.

       % fs checkvolumes
    

    where checkv is the shortest acceptable abbreviation of checkvolumes.

The following command confirms that the command completed successfully:

   All volumeID/name mappings checked.

To flush one or more mount points

  1. Issue the fs flushmount command.

       % fs flush [<dir/file path>+]
    

    where

    flushm

    Is the shortest acceptable abbreviation of flushmount.

    dir/file path

    Names each mount point to flush from the cache. Omit this argument to flush the current working directory. Files or subdirectories cached from the associated volume are unaffected.