2007-11-20 21:13:43

by Stefanovich

[permalink] [raw]
Subject: Files getting out of sync between client/server

Hi,

I have a problem that when uploading files to our NFS server. The
problem occurs when we overwrite a file using ftp. What happens is
that on the server the file is uploaded and updated correctly, however
on our nfs clients the file itself doesn't update, it actually retains
the information from the previous version of the file. I have tried to
remount the clients when this occurs but that doesn't fix the problem.
So far the only way I have found to correct this issue is to
physically reboot the client machines. Just wondering if anyone knows
why this might be happening, and any idea on a fix or what I am doing
wrong?


2007-11-20 21:45:13

by Trond Myklebust

[permalink] [raw]
Subject: Re: Files getting out of sync between client/server


On Tue, 2007-11-20 at 13:13 -0800, Stefanovich wrote:
> Hi,
>
> I have a problem that when uploading files to our NFS server. The
> problem occurs when we overwrite a file using ftp. What happens is
> that on the server the file is uploaded and updated correctly, however
> on our nfs clients the file itself doesn't update, it actually retains
> the information from the previous version of the file. I have tried to
> remount the clients when this occurs but that doesn't fix the problem.
> So far the only way I have found to correct this issue is to
> physically reboot the client machines. Just wondering if anyone knows
> why this might be happening, and any idea on a fix or what I am doing
> wrong?

Does the new file keep the same inode number as the previous one? If so,
then the problem is likely to be because you are keeping the file open
while the other client is writing to it. That is forbidden in the
close-to-open cache consistency model that most NFS clients implement.

Cheers
Trond


2007-11-20 21:51:48

by david m. richter

[permalink] [raw]
Subject: Re: Files getting out of sync between client/server

On Tue, 20 Nov 2007, Stefanovich wrote:

> Hi,
>
> I have a problem that when uploading files to our NFS server. The
> problem occurs when we overwrite a file using ftp. What happens is
> that on the server the file is uploaded and updated correctly, however
> on our nfs clients the file itself doesn't update, it actually retains
> the information from the previous version of the file. I have tried to
> remount the clients when this occurs but that doesn't fix the problem.
> So far the only way I have found to correct this issue is to
> physically reboot the client machines. Just wondering if anyone knows
> why this might be happening, and any idea on a fix or what I am doing
> wrong?

the client usually caches data for about 30 seconds, IIRC, so one
would expect the potential for some sort of window, but unmounting and
remounting should invalidate all of the client's caches. what happens if
the client waits for "a while" -- can you see the data then? and what
happens if the client touches the file and then rereads it, maybe (lame, i
know)? but, regardless, i don't understand the unmount/remount thing at
all.

what kernel version(s) are you using?

d
.