Testing for Vision File Locking Compatibility

The V_LOCK_METHOD configuration variable specifies the locking method for Vision files. When V_LOCK_METHOD 2 is set, the 'asynchronous reads' method is in effect, which can improve performance by reducing the number of locks required.

However, in order to use this setting, your file system must be able to perform atomic file operations. Not all environments are capable of this, and so if you want to set V_LOCK_METHOD 2, you should run the following test to ascertain if your file system is compatible with this setting.

CAUTION:
If you set V_LOCK_METHOD 2 on a system that cannot process file operations atomically, this will more than likely result in spurious file errors or file corruption.

The command syntax is:

vutil -wtest /path/to/file test-duration

Specify an existing directory on your file system, in which a temporary Vision file is created for the duration of the test. The test-duration is the length in seconds that the test will run; if you omit this argument or specify less than 30, the test will run for the default 30 seconds.

During the test, blocks of characters are written to the temporary file and read back in a separate thread until either the indicated time elapses or an inconsistent read is encountered. A message will then be displayed showing the results of the test.

If the test passes, this indicates that the system did not allow the thread reading the data to see the data in an intermediate state, and thus V_LOCK_METHOD 2 can work reliably in this environment.

If a block is read that contains inconsistent data, this indicates that the file system does not ensure that data written in a single system call can always be read back consistently, and intermediate results may be seen. In this case, V_LOCK_METHOD 2 cannot operate reliably, and must not be used.

Note: The file system type and its mount options may affect the results of this test: different file systems on the same system may produce different results. Ensure that you run this test on the file systems that will hold the Vision files that are to be accessed using the V_LOCK_METHOD 2 configuration.