On Tue, 5 May 2015 12:05:51 -0700
Charles Munger <clm at google.com> wrote:

> At https://www.sqlite.org/mmap.html, the documentation mentions:
> 
> "An I/O error on a memory-mapped file cannot be caught and dealt with
> by SQLite. Instead, the I/O error causes a signal which, if not
> caught by the application, results in a program crash."
> 
> It seems to me that a naively implemented handler might introduce
> database coherency bugs and other issues. Is there anywhere where I
> can read about how one might implement such a signal handler
> correctly, to gracefully recover the same way any as other sqlite I/O
> error?

Not that I know of.  ISTM one goal should be to convert the signal into
something that results in a rollback.  Then perhaps the user can
remove unneeded files and release enough space for the operation to
continue.  But if the problem is failing hardware, no amount of
signal-handling will reliably prevent file corruption.  

--jkl

Reply via email to