Hello All,
I'm trying to get to the bottom of a problem my customers are experiencing
while serving files that are checked out from SVN on one server on an NFS
mount and served by Apache from NFS mounts on other hosts.
The problem is not limited to SVN, it is also created by "move" commands
issued on the server (see below).
The setup is as following:
* One shellserver has all homedirs mounted over NFS.
* Clients distribute their sourcecode to several accounts
through SVN update commands.
* Webservers serve the checked out files from similar NFS mounts.
When updating the checkout and thereby modifying a file named (say
"testfile"), SVN creates a temporary file (say "testfile.tmp") in which
the new content is stored. To guarantee atomicity "testfile.tmp" is then
moved over "testfile". So far so good on the shellserver.
This is where things go wrong on the webserver hosts, however:
1) The NFS client on the webserver thinks the original file is still in
use.
2) Apache accesses the old inode.
3) Apache gets ESTALE and returns a FORBIDDEN status.
The file is no longer served.
Let us agree that this destroys any chance of using SVN over NFS :)
This is easily recreated using an NFS server and two hosts that have an
export mounted. Let's do things with "mv" only, just to show that the
problem is not subversion's:
1) On one host (A), create an NFS export. Mount it somewhere on the same
machine.
2) On another host (B), mount the same export.
3) Create a file on (A).
4) Access the file on (B) through the fileserver.
5) Create a new file, move it over "testfile".
6) Access the file on (B) through the fileserver
ESTALE :(
[Fri May 23 11:44:40 2008] [error] [client 82.95.102.2] (116)Stale NFS
file handle: access to /test/testfile failed
Now I know that ESTALE is a critical error. However, something is done
differently between Apache and for example "cat".
Now, moving files over other files is pretty common so I really need to
fix the problem.
* Is this known behaviour?
* Is it even Apache's fault?
* Why does stat work but does Apache fail to server the file?
There are some additional links at the bottom of the mail for reference.
Thanks for your time!
Regards,
Allard Hoeve
Response by an NFS developer:
http://sourceforge.net/mailarchive/message.php?msg_name=20080522214136.GB18822%40fieldses.org
Another summary:
http://linux-nfs.org/pipermail/nfsv4/2008-April/008452.html
Same problem, other reporter:
http://linux-nfs.org/pipermail/nfsv4/2008-April/008423.html