logoalt Hacker News

Someonelast Friday at 8:18 PM0 repliesview on HN

> The designers of NFS chose to make a distributed system emulate a highly consistent and available system (a hard drive),

> The original NFS protocol is stateless,

The protocol is, but the underlying disk isn’t.

- A stateless emulation doesn’t know of the concept of “open file”, so “open for exclusive access” isn’t possible, and ways to emulate that were bolted on.

- In a stateless system, you cannot open a scratch file for writing, delete it, and continue using it, in the expectation that it will be deleted when you’re done using it (Th Unix Hater’s handbook (https://web.mit.edu/~simsong/www/ugh.pdf) says there are hacks inside NFS to make this work, but that makes the protocol stateful)

> It didn't require every existing tool, such as ls, to deal with things like the server rebooting while listing a directory

But see above for an example where every tool that wants to do record locking or get exclusive access to a file has to know whether it’s writing to a NFS disk to figure out how to do that.