Is SQLite compatible with OpenAFS locking?

I would like many processes on many networked computers to access the same SQLite database at the same time through OpenAFS 1.4.12.1. Entries will be infrequent, so a single-task SQLite design should not be a problem.

I would like to know if this is possible. I am having trouble finding two important pieces of information:

The SQLite documentation states that "SQLite uses POSIX control blocks to implement locking on Unix." He also warns that "your best defense is not to use SQLite for files on a network file system." However, it does not seem to indicate whether SQLite uses only the entire file lock or whether it uses byte lock.

I also had trouble finding which types of OpenAFS 1.4.12.1 locks are supported. This unofficial source since 1998, unfortunately, is the best source I could find. At that time, blocking the whole file was supported, but blocking bytes was not.

Only this page appears in the official documentation , which, in spite of this, a friendly heading, does not actually say anything about whether POSIX support the latest OpenAFS is supported.

EDIT: Is that even possible? If so, do I need any SQLite flags to compile time?

+5
source share
1 answer

SQLite "" . , SQLite Unix.

, (, flock() dotlock-style ). SQLITE_ENABLE_LOCKING_STYLE .

(, "ufs", "nfs" "smbfs" ), AFS. , SQLite fcntl(). , fcntl() , .

OpenAFS , - . - ([1], [2], [3]). OpenAFS . openafs-1.4.14:

/* next line makes byte range locks always succeed,
 * even when they should block */
if (af->l_whence != 0 || af->l_start != 0 || af->l_len != 0) {
    DoLockWarning();
    afs_PutFakeStat(&fakestate);
    return 0;
}

: Ouch!

, . Linux, , : . , . , .

: SQLite OpenAFS. , .

:

  • , PostgreSQL. , .

  • , .

  • SQLite flock() OpenAFS. , , OpenAFS ([1], [2]) flock(), , .

  • OpenAFS VFS SQLite OpenAFS, .

  • .

, , , - SQLite3 .

EDIT:

, . OpenAFS, , , open(O_CREAT|O_EXCL) , SQLite . , , SQLite OpenAFS, .

, , , .

+5

All Articles