Unformatted text preview: hapter 29. NFS: Network File System Idempotent Procedures
An RPC procedure is called idempotent if it can be executed more than once by the server
and still return the same result. For example, the NFS read procedure is idempotent. As
we saw in Figure 29.9, the client just reissues a given READ call until it gets a response.
In our example the reason for the retransmission was that the server had crashed. If the
server hasn't crashed, and the RPC reply message is lost (since UDP is unreliable), the
client just retransmits and the server performs the same READ again. The same portion of
the same file is read again and sent back to the client.
This works because each READ request specifies the starting offset of the read. If there
were an NFS procedure asking the server to read the next N bytes of a file, this wouldn't
work. Unless the server is made stateful (as opposed to stateless), if a reply is lost and the
client reissues the READ for the next N bytes, the result is different. This is why the NFS
READ and WRITE procedures have the client specify the starting offset. The client
maintains the state (the current offset of each file), not the server.
Unfortunately, not all filesystem operations are idempotent. For example, consider the
following steps: the client NFS issues the REMOVE request to delete a file; the server
NFS deletes the file and responds OK; the server's response is lost; the client NFS times
out and retransmits the request; the server NFS can't find the file and responds with an
error; the client application receives an error saying the file doesn't exist. This error return
to the client application is wrong-the file did exist and was deleted.
The NFS operations that are idempotent are: GETATTR, STATES, LOOKUP, READ,
WRITE, READLINK, and READDIR. The procedures that are not idempotent are:
CREATE, REMOVE, RENAME, LINK, SYMLINK, MKDIR, and RMDIR. SETATTR
is normally idempotent, unless it's being used to truncate a file.
Since lost responses can always happen with UDP, NFS servers need a way to handle the
View Full Document
This test prep was uploaded on 04/04/2014 for the course ECE EL5373 taught by Professor Guoyang during the Spring '12 term at NYU Poly.
- Spring '12