On Mon, Apr 19, 2010 at 10:55 AM, Andrew Deason <[email protected]> wrote: > On Mon, 19 Apr 2010 09:41:06 -0600 > Ken Dreyer <[email protected]> wrote: >> flock - Whole-file locking. This completely hung on Solaris when >> opening sqlite files on read-only mounts. Even if the SQLite >> operations were read-only (SELECT, etc), PHP hung. >> dot-lock - did not work, as SQLite wanted to write dot-files to our >> read-only mounts. > > Er, by 'read-only mounts' you do mean directories where you only have > read permissions, right? Not mounting RO volumes?
I meant the latter. We need SQLite to be able to read from RO volumes, and read/write to RW volumes. With SQLITE_FIXED_LOCKING_STYLE=flockLockingStyle I can read and write to RW volumes, but any operation on an SQLite file in a RO volume hangs. At first I wondered if this was a problem with *all* flock() calls on RO volumes, but I wrote two test programs (C and PHP, attached) to do a simple shared lock with flock(), and these work on RO and RW volumes. This makes me think that the problem may be with SQLite's code, or PHP's use of SQLite. With these test results, I was hesitant to open a bug with OpenAFS yet. On Mon, Apr 19, 2010 at 10:01 AM, Derrick Brashear <[email protected]> wrote: > can i suggest trying it on a directory where you have rlk and not merely rl? The ACLs were one of the first things I looked at, but "k" seemed to have no effect. I will try to build SQLite aside from PHP to see if I can narrow the problem further. I'll try to provide backtraces / cmdebug too, when I can pull them together. - Ken
/*
* built on Solaris with
* gcc -L/usr/ucblib/ -R/usr/ucblib/ -g lock.c -o lock -lucb
*/
#include <stdio.h>
#include </usr/ucbinclude/sys/file.h>
int main()
{
int f; /* File */
fprintf(stderr, "Opening file...");
/* A file in an AFS volume, RW or RO */
if(-1 == (f = open("lock.txt", O_RDONLY )))
{
fprintf(stderr, "Failed.\n");
return(1);
}
fprintf(stderr, "Done.\n");
fprintf(stderr, "Setting a shared lock on the file...");
if(-1 == flock(f, LOCK_SH))
{
fprintf(stderr, "Failed.\n");
return(1);
}
fprintf(stderr, "Done.\n");
return 0;
}
<<attachment: lock.php>>
