Handling of corrupted databases¶
The database offered by LocalSearch is a fast access cache of filesystem data. In the unlikely event of major database corruption (e.g. filesystem-level corruption), this data can be disposed and reproduceably rebuilt with no major loss other than the CPU and I/O time spent.
Still, the preferred action is to attempt database repairs first. The expected order of events is:
localsearch-3
receives an unexpectedTRACKER_SPARQL_ERROR_CORRUPTED
error from the TinySPARQL library.- The
localsearch-3
service will handle this error by exiting uncleanly. - The process gets restarted.
- When the database is re-opened, the TinySPARQL library will detect the prior corruption, and run repair attempts. See the related library documentation for more details.
- If the repair attempt failed, the corrupted database file(s) will be moved
aside at
~/.cache/tracker3/files.$TIMESTAMP
, and the filesystem data will be reindexed from scratch.