On Mon, Apr 12, 2010 at 12:34:23AM -0400, Derrick Brashear wrote:
> On Sun, Apr 11, 2010 at 11:13 PM, Adam Megacz <[email protected]> wrote:
> >
> > Brandon Simmons <[email protected]> writes:
> >> Thanks for the response. It seems like whole-file locking in sqlite
> >> would be a good choice for me in any case,
> >
> >> In a situation where the whole-file locking scheme is used, would AFS
> >> be an acceptable choice? Would it be better than NFS?
> >
> > I had the same idea, and tried it. It does not work. Your databases
> > will get corrupted. I never figured out why, although I did confirm
> > that sqlite was in fact requesting only whole-file locks.
> >
> > It would be nice if it worked, though. There are a lot of applications
> > out there where writes to the database are extremely rare, so
> > invalidating all the clients' caches is not a problem.
>
> do you happen to know what the corruption looked like (blocks of
> zeroes, just not readable, something else)
>
> --
> Derrick
On 27 Oct 2008 I had a question about flock on AFS, because I did not
understand how flock should work on AFS at all. May I repeat this question:
Hello,
today I am totally confused how the flock(2) call should work on
AFS files.
Normally locking works in the following way:
1 fd = open("afs-file",O_RDWR)
do something
2 flock(fd,LOCK_EX)
do something with "afs-file"
3 flock(fd,LOCK_UN)
do something
4 close(fd)
When there are two processes (on different machines) executing that
code, the (2) flock call has to update the local copy of the afs-file,
otherwise locking is useless. And the (3) flock call has to sync the
local copy with the fileserver.
Writing a small test program I see that this synchronization isn't done.
How can I use the flock(2) call on AFS files?
Thank you for any help,
--
Hans-Werner Paulsen [email protected]
MPI für Astrophysik Tel 089-30000-2602
Karl-Schwarzschild-Str. 1 Fax 089-30000-2235
D-85741 Garching
_______________________________________________
OpenAFS-info mailing list
[email protected]
https://lists.openafs.org/mailman/listinfo/openafs-info