NFS - Network File System
General idea
- using RPC(based on UDP)
- no local disk
- stateless protocol
- using file handlers <volume ID, inode #, gen #>
Client & Server
Read a file
Server
- error handling: write buffer(return success after writing into disk)
if return success when after writing into memory, see the graph below, which is not a correct state
memory | disk | potential result |
---|---|---|
A | X | X |
B | Y | B |
C | Z | Z |
if return success when after writing into disk, see the graph below, which is a correct state
memory | disk | potential result |
---|---|---|
A | X | X |
B | Y | B |
C | Z | C |
Client side cache
There are two problems:
- Update Visibility
server doesn’t have the latest version
Solution: flush on file descriptor close
- Stale Cache
client doesn’t have the latest version
Solution: recheck before using cache