Open Bug 1595010 Opened 5 years ago Updated 2 years ago

IDB: Better handling for filesystem errors and broken directories

Categories

(Core :: Storage: IndexedDB, enhancement, P3)

enhancement

Tracking

()

People

(Reporter: janv, Unassigned)

References

(Depends on 1 open bug)

Details

We need a fallback mechanism for cases when we are not able to remove a file or directory from disk. For example, the telemetry for IDB_GetEntry tells us that there are failures when we try to remove unknown directory in idb/ (or .files directory w/o a sqlite database).
Situations like this could be handled by orphaning such IDB databases (trying to delete it later) and creating a new directory for it, so the database or entire origin can be usable again.

The current layout on disk looks like this:
<profile>/storage/origin1/idb/
db1.files/
db2.files/
db1.sqlite
db2.sqlite

The new layout could look like this:
<profile>/storage2/UUID1/
files/
database.sqlite

<profile>/storage2/UUID2/
files/
database.sqlite

QuotaManager would provide APIs for creating all the mappings. So a directory under storage2/ wouldn't be an origin directory, just a directory.

We probably wouldn't orphan such databases as part of temporary storage initialization, it would be done when the origin and IDB is actually really needed.

Summary: Better handling for data corruption and broken directories → IDB: Better handling for data corruption and broken directories
Priority: -- → P3

Renaming this bug to differentiate from SQLite corruption errors.

Summary: IDB: Better handling for data corruption and broken directories → IDB: Better handling for filesystem errors and broken directories
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.