Quote:
Originally Posted by JohnnyChimpo
Is there any way to avoid these situations? How could it have been made corrupt?
|
I don't really know what happened but if there was a sudden failure (power outage, server crash, etc.) there is potential for corruption. It's also possible there was disk or memory corruption but that sounds unlikely since it coincided with some kind of server crash.
Given that the recommended mode for running your databases in Graal is with SYNCHRONOUS set to OFF, it's kind of surprising it took this long for a database to become corrupted. From
the SQLite docs (emphasis mine):
Quote:
When synchronous is FULL (2), the SQLite database engine will use the xSync method of the VFS to ensure that all content is safely written to the disk surface prior to continuing. This ensures that an operating system crash or power failure will not corrupt the database. FULL synchronous is very safe, but it is also slower. When synchronous is NORMAL (1), the SQLite database engine will still sync at the most critical moments, but less often than in FULL mode. There is a very small (though non-zero) chance that a power failure at just the wrong time could corrupt the database in NORMAL mode. But in practice, you are more likely to suffer a catastrophic disk failure or some other unrecoverable hardware fault. With synchronous OFF (0), SQLite continues without syncing as soon as it has handed data off to the operating system. If the application running SQLite crashes, the data will be safe, but the database might become corrupted if the operating system crashes or the computer loses power before that data has been written to the disk surface. On the other hand, some operations are as much as 50 or more times faster with synchronous OFF.
|
This is mostly speculation and maybe Stefan or someone else can provide more information as I don't really know what happened.