Quoth Simon Slavin <slav...@bigfraud.org>, on 2011-01-20 00:55:18 +0000:
> Agreed.  I was imagining that one file was on an external hard disk
> and the other was on an internal disk.  If the power to the external
> hard disk goes off, one file will get updated but the other won't.
> I don't know enough about the inner workings of SQLite to know if it
> can cope.

I suspect that for the files themselves it's okay so long as fsync is
actually a hard sync (and not just a reordering barrier), which it's
supposed to be anyway.  I don't believe SQLite can be making any
assumptions regarding the reordering of unsynchronized writes between
files on a single device; if fsync is a hard sync then any ordering
semantics are already propagated through the application to the other
device in turn.

However, if either file ever gets created or deleted during normal
operation, then you have the problem of needing to sync the directory,
and that probably won't work because SQLite won't hit the correct
directory for whichever file is actually somewhere else.  Also, if one
file is a symlink and it gets deleted and recreated, then it will be
recreated on the wrong filesystem.  This suggests that actually the
main database should be the symlink if one goes that route, and it
should be precreated as an empty file (and synchronized to storage)
before any operations begin.

Either way, it's an unsupported configuration and should only be used
with extreme caution, especially if the SQLite component may later be
replaced with the expectation of backwards compatibility.

> Simon.

   ---> Drake Wilson
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to