When c-tree Server was run with the file open and close optimization enabled, if two connections open the same file at the same time using different path specifications, one of the open calls could fail with the following symptoms:
On Unix - File open may fail with error 463 (UQID_ERR, file uniqueness error) and unique file ID error messages such as the following may be logged to CTSTATUS.FCS:
- User# 00023 Unique File ID error [7,0]: op=1 fid=1219 sid=39000011x tid=5d9b8dc6x: 2
- User# 00023 /home/fctech/jeff/chkout/stree.org/build/srv/bin/debug/data/mark.idx: 2
- User# 00023 chnacs=y uerr=0 fileid=1219 servid=39000011x timeid=5d9b8dc6x: 463
- User# 00023 mark.idx: 463
- User# 00023 /home/fctech/jeff/chkout/stree.org/build/srv/bin/debug/data/mark.idx: 463
- User# 00023 I0000001.FCS
- User# 00023 KMAT_ERR: indx: 0 1ax call: 0 1bx
- User# 00023 Unique File ID error [6,4]: op=2 fid=1219 sid=39000011x tid=5d9b8dc6x: 3
- User# 00023 /home/fctech/jeff/chkout/stree.org/build/srv/bin/debug/data/mark.idx: 3
- User# 00023 WARNING: unique file ID delete failed: 8770
On Windows - File open may fail with error 920 (FNAC_ERR, the file exists but could not be accessed).
Another possible symptom that can be caused by the file open optimization is that a call to delete a file might fail internally because another connection has opened the file. In this case the function call returns success even though the file could not be deleted from disk. If the delete occurs during a failed create attempt (for example if the data file create succeeds but the index file create fails), the data file is left on disk without its resource anchor set, which causes a subsequent open of the file to fail with error 401. If the delete is during a call to delete the file (for example, DELRFIL()), the file is left on disk with its update flag set, which causes a subsequent open of the file to fail with error 14.
Workaround: Disable the file open and close optimizations by adding the options OPTIMIZE_FILE_OPEN NO and OPTIMIZE_FILE_CLOSE NO to the server configuration file (ctsrvr.cfg) and restart c-tree Server. A possible side effect of disabling these optimizations is slower performance for file open and close operations.
Affected Components: c-tree Server, V11.6.1 and later.
When the file open optimization is enabled, the logic has been modified to ensure that only one thread opens a file when it is not already open. The logic has been modified so that path differences do not prevent finding the entry for the file. This means that opens of a file having the same name but a different path will be serialized when the two files are not already open, but this is expected to be an uncommon occurrence.