On Sun, Jan 30, 2011 at 11:06:34AM +0800, Ginn Chen wrote: > I think a single process accessing a single Sqlite database at a time over > NFS is supposed to be fine. > > But it is not working on Solaris. > On Solaris, man page of mmap() has > > EAGAIN The file to be mapped is already locked using > advisory or mandatory record locking. See > fcntl(2). > > I found if the file on NFS has been locked with fcntl(), mmap() may fail.
Right, because mmap()s can be inherited by child processes, and there's [performant] no way to enforce mandatory record locking then. I don't know why it'd fail in the case of advisory locking though. I'll inquire. > It doesn't fail if both l_start and l_end are 0. > > Thus, I got "Error: disk I/O error" for any operation after setting > journal_mode to WAL. > See https://bugzilla.mozilla.org/show_bug.cgi?id=629296 > > The problem is setting journal_mode to WAL is successful, but it cannot be > set back. > User has to move the db file to another filesystem and set journal_mode to > delete. > > I guess -DSQLITE_SHM_DIRECTORY="/var/tmp" might be a solution, but it is > unsupported. You don't want to do that, no. > Any idea how can we make the behavior better on Solaris? > Maybe fallback to another lock method if it is on NFS? I could use more information. Say, a truss -v all -t all -f sqlite3 ... Nico -- _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users