Guardian Programmer's Guide

Table Of Contents
Writing a Requester Program
Guardian Programmer’s Guide 421922-014
21 - 6
Sync-Depth in Practice
Sync-Depth in Practice
The following is the sequence of events that occurs for a path error retry, which is
performed automatically if the sync depth value is greater than 0.
The requester sends an I/O to the server. The file system increments the sync ID
for the file and locates the server using the process handle determined at open
time. The request is then sent to the server process.
Consider a scenario where the request fails with a path error because the server
switched to its backup process. The switch causes the process pair’s PPD entry to
be updated, because the primary server process stopped and the backup server
process assumed the primary role. In this case, the following occurs:
The request is sent to the server.
A path error occurs because the server’s primary process fails. This causes the
server to switch to its backup process.
The file system checks the sync depth and determines that the request must
be retried automatically (sync depth value is greater than 0). If sync depth
value is 0, the path error is returned to the requester.
Because the sync depth value is greater than 0, the file system resends the
request, this time to the backup process, which has taken over. The sync ID is
not incremented.
The server uses sync IDs to determine how to handle the request:
If the sync depth value is less than the sync ID minus the last saved sync
ID, then the request is too old. The server returns an error indicating that
the request is too old.
If the sync ID is otherwise less than or equal to the last saved sync ID, then
it is a duplicate request. The corresponding saved result is returned
immediately. If the server is multithreaded, the original request might not
be completed, in which case the old request tag is released and replaced
with the new request tag.
If the sync ID is greater than the last saved sync ID, then it is a new
request. The request is processed normally. When the response occurs, it
is saved together with the sync ID.
The first time the server received the request, it was treated as a new request.
The second time the same request is received, it might be a duplicate request
or a new request, depending on at which point the server’s backup process
resumed processing. If it is a duplicate request, the server replies with the
saved response, indicating a successful I/O completion.
The requester I/O finishes.
Because the sync depth value is greater than 0, there is no indication in the requester
that a path retry has been performed.