Thanks Simon for the response! On 12/21/17 5:05 PM, Simon Slavin wrote:
When "pragma integrity_check" detects an error, does "PRAGMA quick_check" do too ?
Yes, both pragmas return same error.
Is your database file really about 65 Meg in size ? Just roughly.
Yes: $ du -sh * 66M appliance_stats.sqlite 32K appliance_stats.sqlite-shm 4.2M appliance_stats.sqlite-wal num_pages X page_size seem to match file system metadata, fsck has not revealed any inconsistencies.
How is your application terminated ? User action or self-determination ?
The writer process receives a SIGTERM and in that handler signals a condition that is waited by all other threads (when not doing any work). If the threads are doing any work, they finish it and then wait on the condition. Threads are not abnormally terminated. The writer process runs till the VM is shutdown.
Does your application call sqlite3_close() ? Does it cbeck the code returned ? Does your application call sqlite3_shutdown() ? Does it cbeck the code returned ?
Yes, the return codes are logged and used as process exit code, our logs do not show non-zero error codes/logs.
How does your VM get shutdown ? Does it correctly shut down your application before it quits ?
VM shutdown is normal shutdown with systemd shutting down a simple watchdog that forwards shutdown to the SQLite DB writer process.
Can you include a "pragma integrity_check" at startup ? Can you include a "pragma integrity_check" executed at regular intervals ?
The writer process does "pragma quick_check" on every startup at init, bails out on failure and spawns a separate thread to do same "pragma quick_check" every 5 minutes (opens it's own separate DB handle and closes it). Would changing quick_check to integrity_check be helpful? (Would integrity_check catch such corruption earlier than quick_check? Would it hold longer exclusive locks on the DB file that could prevent reads?) Thanks, Nikhil _______________________________________________ sqlite-users mailing list sqlite-users@mailinglists.sqlite.org http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users