Closed Bug 1621916 Opened 5 years ago Closed 4 years ago

Ignore unknown files in client directories during temporary storage initialization

Categories

(Core :: Storage: Quota Manager, task, P1)

task

Tracking

()

RESOLVED FIXED
mozilla79
Tracking Status
firefox79 --- fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug)

Details

Attachments

(18 files)

47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review
47 bytes, text/x-phabricator-request
Details | Review

This mostly involves IndexedDB client directory, but we should verify that other quota clients don't have this problem either.

Assignee: nobody → jvarga
See Also: → 1624586
Priority: P2 → P1
Severity: normal → S3

We plan to replace this test with more thorough tests in bug 1620277, but for
now it's still needed and will be part of a short term fix for ignoriging
unknown files and directories.

A generated profile now matches real world profiles:

  • contains directory metadata
  • contains real quota client specific files
  • contains unique non-empty unknown files (instead of empty foo.bar files)
  • contains unique non-empty unknown directories (instead of empty foo dirs)

There's now only one origin directory which contains unknown files and
directories. All methods that take a principal are verified to work with the
origin direcrtory.

Depends on D76095

SimpleDB files on disk now use a suffix, so unknown files can be filtered out.

Depends on D76700

The functionality needs to be verified for all initialization states (modes)
since some methods don't automatically trigger temporary storage initialization
which results in calling different quota client methods (for example
GetUsageForOrigin calls either Client::InitOrigin or Client::GetUsageForOrigin).

Depends on D76701

All unknown files in the files and journals directory are now properly filtered
out if the filename can't be converted to an integer.

Depends on D76702

Cache API is currently not consistent regarding unknown files. Some unknown
files are reported and ignored, other unknown files are reported and deleted or
just silently deleted without a warning.
Quota Manager, IndexedDB, SimpleDB and LocalStorage currently report and ignore
such files. We should try to unify this in future.

Depends on D76717

The method returns a database filename without any extension, so the method name
needs to express that.

Depends on D77068

Keywords: leave-open
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/509f8842782a Simplify test_unknownFiles.js by merging stage 1 and stage 2; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/f3bc1c339aef Remove redundant checks that were needed before we started ignoring unknown files and directories; r=dom-workers-and-storage-reviewers,sg

There will be some followup patches, but the core problem should be covered by the patches that have been already submitted.

Attachment #9150363 - Attachment description: Bug 1621916 - Update test_unknownFiles.js with unknown files for cache, sbd and ls quota client; r=#dom-workers-and-storage-reviewers → Bug 1621916 - Update test_unknownFiles.js with unknown files for cache, sdb and ls quota client; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b9737a318730 Convert test_unknownFiles.js to use async functions; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/6a5e10dfd0d0 Convert test_unknownFiles.js to use quasi subtests; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/3af8bec13325 Enhance test_unknownFiles.js to cover initTemporaryStorage method; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/904cc259a98d Update test_unknownFiles.js with unknown files for cache, sdb and ls quota client; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/3e78d35a061c Extract profile creation from test_unknownFiles.js into make_unknownFiles.js and make it more sophisticated; r=dom-workers-and-storage-reviewers,ttung
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/cb80856ac40b Fix SimpleDB to ignore unknown files during initialization and usage calculation; r=dom-workers-and-storage-reviewers,ttung
Attachment #9152095 - Attachment description: Bug 1621916 - Renane GetBaseFilename to GetFilenameBase to match rest of the code; r=#dom-workers-and-storage-reviewers → Bug 1621916 - Rename GetBaseFilename to GetFilenameBase to match rest of the code; r=#dom-workers-and-storage-reviewers
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/b1a0dc2886ce Run test_unknownFiles.js in multiple modes; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/5a575e559146 Fix IndexedDB to ignore unknown files in the files and journals directory during initialization and usage calculation; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/3dfe670a0bd2 Unify reporting of unknown files across quota manager, idb, sdb and ls quota client; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/3bee45f35de2 Add unknown files for Cache API morgue directory and its subdirectories; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/a235cbd69f6f Rename GetBaseFilename to GetFilenameBase to match rest of the code; r=dom-workers-and-storage-reviewers,ttung https://hg.mozilla.org/integration/autoland/rev/29086c8c3e4e Rename GetDatabaseFilename to GetDatabaseFilenameBase; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/24d3d987b60d Remove unnecessary local variables; r=dom-workers-and-storage-reviewers,sg https://hg.mozilla.org/integration/autoland/rev/c3f73781a871 Remove unused argument in Client::InitOrigin; r=dom-workers-and-storage-reviewers,sg
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/d62da1a75701 Fix IndexedDB to ignore unknown files in the client directory during initialization and usage calculation; r=dom-workers-and-storage-reviewers,sg,ttung
Keywords: leave-open
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/3f5baab34b1f Provide a usable stack when requestFinished throws; r=dom-workers-and-storage-reviewers,sg,asuth
Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/06ab04be7c08 Provide a usable stack when requestFinished throws; r=dom-workers-and-storage-reviewers,sg,asuth
Status: NEW → RESOLVED
Closed: 4 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla79
Flags: needinfo?(jvarga)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: