Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 5
Sync-Depth
with nonretryable I/Os that are not audited (protected by TMF transactions).
Synchronization is done by the participating processes; however, the file system might
automate the path-failure handling for the requester.
Note that processes that open $RECEIVE and other files are considered both
requesters and servers in the context of this discussion.
A process is a server while processing a message received through $RECEIVE.
A process is a requester while performing I/O on other files it has opened.
The FILE_OPEN_ parameter sync-depth is used to tell the file system and the server
important information about how an opened file must be accessed.
Sync-Depth
The sync-depth parameter has several functions, depending on the device type, but its
most important function is to tell the server how many responses it needs to save.
Each opened process file has a 32-bit sync ID value that the file system automatically
increments by one for each nonretryable operation issued (for example, in WRITE or
WRITEREAD operations). Each I/O request has a sync ID value that enables the
server to detect duplicate requests. A server can retrieve the sync ID by calling
FILE_GETRECEIVEINFO_. For each opener, the server saves the result and the sync
ID of the last request that was successfully processed. When a new request is read
from $RECEIVE, the server compares the sync ID value with its last processed sync
ID. If the new sync ID is less than or equal to the value of the saved sync ID value, the
request is a duplicate.
Servers must be written to handle sync depth and sync ID values. For example, a
request is too old if the new sync ID minus the saved sync ID is greater than or equal
to the sync depth value. This situation can occur as a result of an application error,
which the server must be coded to handle. Some high-level languages, like COBOL85,
handle sync depth processing automatically. A new request always has a sync ID
value that is equal to the saved sync ID value plus 1.
Sync-depth value Description
0 Any error is immediately returned with no retry attempted.
W
RITE operations of disk files are not checkpointed.
> 0 (greater than 0) Enables the file system to automatically retry any path error that
m
ight occur (file-system errors 200 through 211). Path error
retries are transparent to the requester. For disk files, checkpoints
of WRITE operations are enabled.
n The number of nonretryable operations the requester might
pe
rform between file sync block checkpoints. To handle this, the
server must “remember” or save the n most recent responses.
The server must handle a duplicate request that is up to n
requests old by immediately returning a saved response
corresponding to the original request
.