application-services icon indicating copy to clipboard operation
application-services copied to clipboard

Handle database corruption while using the database.

Open mhammond opened this issue 4 years ago • 0 comments

We now handle corrupt databases while opening the DB and have a utility function most components use to handle this - however, this only catches some corruption cases, so we should come up with a strategy to handle corruption while the DB is in use.

This will help us fix #2828 and #2628.

FTR, we see the following sentry errors (note that sentry URLs don't seem stable, so following them may not take you to what is described)

  • this issue reports "Error executing SQL: database disk image is malformed" calling getTopFrecentSiteInfos.
  • this one is confusing - not clear if it is a protobuf error or corruption error, but it is when calling noteHistoryMetadataObservation - but it has 140k events for 72k users.
  • this one reports "places::ffi - Unexpected error: SqlError(SqliteFailure(Error { code: DatabaseCorrupt, extended_code: 11 }, Some("database disk image is malf" calling getVisited.
  • this one is "places::history_sync::plan - incoming: record Guid("-3ERFTg8Mey4") failed to apply: Error executing SQL: database disk image is malforme" while syncing history
  • etc

Not clear what approach we should take to detect all cases, nor what action we can sanely take while while the app is running and after the DB is open, but I'm sure we can come up with something :)

┆Issue is synchronized with this Jira Task

mhammond avatar Nov 10 '21 04:11 mhammond