On 14 Feb 2011, at 4:48pm, Jim Wilcoxson wrote: > I believe (though am not sure) that the drive can reorder individual > sector/record writes between syncs however it likes, as long as it > doesn't allow writes to cross a sync and also executes the sync groups > (for lack of a better term - the group of writes between syncs) in > order.
At the low-level of the device driver there is a distinction between telling the hard disk to 'sync' and 'flush'. They both force all pending writes, but one returns immediately and the other waits until the operation is complete before returning. OS device-drivers writers tend to choose one or the other rather than implement them both, but which one to use is a matter of taste and prejudice. The definitive way to do it is simply to stop giving the drive commands and wait until it says "I have zero writes pending.". Unfortunately it's harder to detect this (you have keep polling) than it is to just issue a 'sync'. Add to this the problems that the drive you're using may be part of a RAID array or even a mounted drive image (because you're running on a virtual machine), and you have a complete nightmare of consistency out there. Simon. _______________________________________________ sqlite-users mailing list sqlite-users@sqlite.org http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users