> A Linux 2.6/x86_64 system reports a "disk I/O error" (SQLITE_IOERR) > while generating a specific report from a SQLite database (SQLite > 3.3.6). The database and temporary files are accessed through an NFS > mount. After running the program again with SQLite tracing enabled > (plus a bit more I added), I see that SQLITE_IOERR is returned by > unixRead() because read() unexpectedly returned 0! > > Here's some relevant strace output: > > open("/nfs/tmp/sqlite_dBjTG5bZdsqFVPb", O_RDWR|O_CREAT|O_EXCL, 0644) = 8 > > [...] > > lseek(8, 193536, SEEK_SET) = 193536 > write(8, "\n\0\0\0\30\0\222\0\0\266\0\332\0\376\1\"\1F\1l\1\222\1"..., > 1024) = 1024 > > [...] > > lseek(8, 226304, SEEK_SET) = 226304 > write(8, "\n\0\0\0\30\0\240\0\0\240\0\304\0\350\1\f\0010\1T\1x\1"..., > 1024) = 1024 > lseek(8, 193536, SEEK_SET) = 193536 > read(8, "", 1024) = 0 > fstat(8, {st_mode=S_IFREG|0644, st_size=227328, ...}) = 0 > > The read() call shouldn't fail -- the same page was written to at the > beginning of the transaction! At least by the time fstat() is called, > the file is 227328 bytes long, so a read at an offset of 193536 should > not fail. > > I'm suspecting that the NFS server in question is buggy or > misconfigured. Unfortunately I don't have access to either the NFS > server or the host running the program, so mainly all I can access is > some strace and SQLite tracing output.
I'd guess that your NFS server's writes are not synchronous. If this is true, then it may be that the NFS server performing the read does not yet have the data in a readable form and returns 0. See "safe asynchronous writes" in http://nfs.sourceforge.net/ Yikes - you're using /nfs/tmp for your temp_store_directory - not good. Use either: PRAGMA temp_store_directory = '/some/local/disk/directory'; or pragma temp_store=memory; to avoid the brutal NFS round trip delays for your temp files. But if you *must* perform writes to the NFS database file, and for some strange reason must use NFS temp store, you might try hacking the unix reads to loop with a usleep delay if it encounters a zero return, giving up and failing after a number of retries. If you could post your findings to the list, that would be great. ____________________________________________________________________________________ Get the free Yahoo! toolbar and rest assured with the added security of spyware protection. http://new.toolbar.yahoo.com/toolbar/features/norton/index.php ----------------------------------------------------------------------------- To unsubscribe, send email to [EMAIL PROTECTED] -----------------------------------------------------------------------------