Closed Bug 1107608 Opened 10 years ago Closed 9 years ago

QuotaManager metadata can be left inconsistent in case of crash

Categories

(Core :: Storage: IndexedDB, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: jld, Unassigned)

References

Details

QuotaManager::EnsureOriginIsInitialized assumes that, if EnsureDirectory didn't need to create the directory, then the metadata file is present and valid.  But, in the case of a crash or unplanned shutdown, we can wind up in other cases — e.g., the metadata file exists but is empty.

I got into the situation with the B2G emulator, and it caused boot to fail before presenting any UI (i.e., would have effectively bricked a device).  That particular case might require hard-rebooting the device during its first boot after a full flash, which hopefully won't happen much in practice, but this seems like a potential source of problems more generally.
Uhm, will have to take a look.
It seems me to me that we should add "journal" files for .metadata files. We already have that for stored files in IndexedDB and it works quite well.
See Also: → 1143607
This should be fixed by bug 1162624.
Status: NEW → RESOLVED
Closed: 9 years ago
Depends on: 1162624
No longer depends on: 1157979
Resolution: --- → FIXED
You need to log in before you can comment on or make changes to this bug.