Open Bug 1593365 Opened Last month Updated 19 days ago

[meta] QuotaManager storage v3

Categories

(Core :: Storage: Quota Manager, enhancement, P2)

enhancement

Tracking

()

People

(Reporter: janv, Unassigned)

References

(Blocks 15 open bugs)

Details

(Keywords: meta)

After more thinking about storage initialization failures and unknown stuff in /storage, I've come to a conclusion that we should get rid of directory traversals for good. We should keep a list of origins and their mapping to directories on disk in a database. Consistency between the database and stuff on disk would be ensured by marker files. Client directories and stuff in some client directories would be managed the same way.
This would solve many problems (including very long file names) and it would open the door for new functionality and optimizations (like getting rid of .metadata-v2 and origin parser, replace flat repository directory structure with multi level repository directory structure).
We wouldn't have to worry about unknown stuff and performance wouldn't be badly affected by too many unknown files that need to be checked during storage initialization.

The new functionality would include for example better support for private browsing and buckets.

(In reply to Jan Varga [:janv] from comment #1)

The new functionality would include for example better support for private browsing and buckets.

and new SessionStorage (for Fission) which needs to support multiple origin directories on disk for the same origin

Priority: -- → P2
Summary: QM: Get rid of directory traversals → [meta] QuotaManager storage v2
Blocks: 1445464
Blocks: 781982
Blocks: 1594740
Blocks: 1056339
Blocks: 1143003
Blocks: 1482662
Blocks: 1157979
Blocks: 1342415
Depends on: 1395133
Blocks: 1395133
No longer depends on: 1395133
Blocks: 1493006
Blocks: 1512750
Blocks: 1522464
Blocks: 1595002
Blocks: 1595010

I originally thought that everything would follow this schema:
<profile>/storage2/
UUID1/
UUID2/
UUID3/

However, asuth suggested that it might be good to have a special case for private browsing:
<profile>/storage2/
UUID1/
UUID2/
UUID3/

<profile>/storage2/pb/
UUID4/
UUID5/
UUID6/

This way, it would be easy to delete private browsing data without loading mappings from storage.sqlite. This can be especially useful when we implement a separate daemon for deleting private browsing data that would be launched after Firefox shutdown.

Actually the final layout would be a bit different, we need multilevel structure like:
<profile>/storage2/00/
UUID1
UUID2
UUID3

<profile>/storage2/01/
UUID4
UUID5
UUID6

<profile>/storage2/02/
UUID7
UUID8
UUID9

Summary: [meta] QuotaManager storage v2 → [meta] QuotaManager storage v3
You need to log in before you can comment on or make changes to this bug.