On 25 January 2016 at 18:26, Meinlschmidt Stefan < Stefan.Meinlschmidt at esolutions.de> wrote:
> > In your case it sounds like a controlled shutdown - is there a reason you > > don't do a full disk sync before that? > > Yes, it is a controlled shutdown, so in my case the /* post-commit logic > */ basically pulls the plug. > > Trouble is that I only control the database, not the shutdown procedure > (this is a commercial product with several hundred people working on > different aspects of the system). So while I can try to ask the shutdown > crew to sync like any real computer would do, I ultimately have no > saying in that but still need to ensure survival of data. > > Without the patch (which I do have applied locally, of course), me and > everyone with a similar usecase get into trouble for relying on the > quite excellent reputation of SQLite. Actually I first fingerpointed to > the flash hardware or its driver, because ?SQLite is well-tested and > doesn't have this kind of bugs? :-) > But if the shutdown procedure doesn't actually sync the disk, surely its not just sqlite users that will suffer? _Anything_ which has done a write() in the last ~10 seconds without sync()ing is going to lose data, and unlike sqlite the vast majority of standard tools _never_ call sync(). Obviously I don't know much about your project/environment, so perhaps this is what you want. It just strikes me as a problem easier solved at the system level is all :) -Rowan