Closed Bug 1833810 Opened 2 years ago Closed 2 years ago

Speedup origin directory iteration when full origin metadata is not needed

Categories

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

defect

Tracking

()

RESOLVED FIXED
115 Branch
Tracking Status
firefox-esr102 --- unaffected
firefox113 --- unaffected
firefox114 + fixed
firefox115 + fixed

People

(Reporter: janv, Assigned: janv)

References

(Blocks 1 open bug, Regression)

Details

(Keywords: regression)

Attachments

(1 file)

Origin clearing, origin listing and IndexedDB database maintenance need to iterate over all origin directories and get metadata for each origin directory. We currently use LoadFullOriginMetadataWithRestore method for that which loads data from the metadata file. Opening and loading of the metadata file is not cheap, so if there are many origin directories the whole operation can take long time. The good news is that we don't use the extra information provided by FullOriginMetadata, like the last access time and the persisted flag. So we can add a new method which just returns OriginMetadata and doesn't touch the metadata file at all.

This should eliminate the spike we see in the shutdown hangs, see bug 1588498 comment 59.
This bug should fix the spike but also speedup other places where we don't need full origin metadata, especially the listing of origins and IndexedDB database maintenance.

Type: task → defect
Keywords: regression
Regressed by: 1781201
See Also: → qm-shutdown-hangs

This is the patch which caused the regression https://phabricator.services.mozilla.com/D176878

Set release status flags based on info from the regressing bug 1781201

[Tracking Requested - why for this release]: The regression from https://bugzilla.mozilla.org/show_bug.cgi?id=1781201 seems bad enough.

Pushed by jvarga@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/fe27ac846ddd Speedup origin directory iteration when full origin metadata is not needed; r=hsingh
Status: ASSIGNED → RESOLVED
Closed: 2 years ago
Resolution: --- → FIXED
Target Milestone: --- → 115 Branch

The patch landed in nightly and beta is affected.
:janv, is this bug important enough to require an uplift?

  • If yes, please nominate the patch for beta approval.
  • If no, please set status-firefox114 to wontfix.

For more information, please visit BugBot documentation.

Flags: needinfo?(jvarga)

Comment on attachment 9334769 [details]
Bug 1833810 - Speedup origin directory iteration when full origin metadata is not needed; r=#dom-storage

Beta/Release Uplift Approval Request

  • User impact if declined: Some users would experience shutdown hangs and crashes much more often.
  • Is this code covered by automated tests?: Yes
  • Has the fix been verified in Nightly?: Yes
  • Needs manual test from QE?: No
  • If yes, steps to reproduce:
  • List of other uplifts needed: None
  • Risk to taking this patch: Low
  • Why is the change risky/not risky? (and alternatives if risky): The new code is rather limited in size and is based on existing code which has been used for long time already. The new code was also manually tested (as addition to testing provided by automatic tests).
  • String changes made/needed: None
  • Is Android affected?: Yes
Flags: needinfo?(jvarga)
Attachment #9334769 - Flags: approval-mozilla-beta?

Comment on attachment 9334769 [details]
Bug 1833810 - Speedup origin directory iteration when full origin metadata is not needed; r=#dom-storage

Approved for 114.0b7.

Attachment #9334769 - Flags: approval-mozilla-beta? → approval-mozilla-beta+
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: