-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 05/29/2010 07:01 PM, Richard Hipp wrote:
>> Good to know.  Would moving to shm_open() help? 

The problem is that unless the networked filesystem provides exclusive locks
that can be retained by one client only then there will always be race
conditions in that client's view of the underlying file and the contents on
the server.  (And if the client's filesystem cache is segmented by user then
only one segment will be able to hold the lock.)

The API (mmap/shm_open) won't make any difference as this is all a property
of the user space API the client application is using, the file system/vmm
implementation in the client kernel, the network file system implementation
in the client and what requests/semantics are available in the network
protocol.  One weak link in the chain and race conditions are possible.

Windows and CIFS/SMB does have the exclusive locking while NFS does not.  If
the backend is Samba then Samba can't prevent concurrent access from Unix
apps on the server and the CIFS clients.

Basically if the shared memory file is networked then there will be hard to
diagnose corruption problems.

Note that shm_open (on Linux anyway) makes a file in /dev/shm (typically
tmpfs) which means it is always on the local machine.

I'd just go with saying that there are absolutely zero circumstances under
which SQLite is supported using a networked filesystem, that there is no way
to reliably diagnose when it is being misused that way, and that there will
be corruption that will be hard to detect as it happens, and can't be fixed
later.

For people who must use a network, the solution is a networked database as
they can reliably ensure data integrity.

Roger
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.10 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/

iEYEARECAAYFAkwCAFcACgkQmOOfHg372QSvWQCgqTA5U0slEKLkSLjb/vb+dXTR
7dYAoM6Z5C22TNDSMhu6REanOebEfp9S
=D1kf
-----END PGP SIGNATURE-----
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to