ECN-4397 Vision file locking compatibility

Type of Change: Enhancement

Product: ACUCOBOL-GT

New Version: 10.1.0

Module: vutil

Machines Affected: All

DESCRIPTION:

A new vutil option has been introduced to enable you to test the compatibility of your file system when setting the 'asynchronous read' method of file locking for Vision files (V_LOCK_METHOD 2). When this method is set, the file system must be able to perform atomic file operations; that is, it must not allow read operations to view the intermediate state of a file currently being written to in another process. If you use this locking method on file systems that cannot perform operations atomically, it can lead to spurious file errors or file corruption.

The new option is -wtest, and can be run from the command line or from the WTest tab from the AcuBench Vision File Utility. It takes one mandatory and one optional argument: an existing directory on your file system (in which a temporary test file is created and written to/read from during the test), and an optional number indicating for how many seconds the test should be run.

vutil -wtest /usr1/vis 60

This example creates the temporary test file in the /usr1/tmp directory and run the test for 60 seconds. If the time argument is omitted or is less than 30, the test will run for 30 seconds.

While the test is running, a series of dots ("....") are displayed to show that the test is progressing normally.

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.