Open Bug 1833141 Opened 3 years ago Updated 10 months ago

Add tests for vacuuming

Categories

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

task

Tracking

()

People

(Reporter: jstutte, Assigned: hsingh)

References

Details

We currently have no test that explicitly checks our vacuuming logic. We should have one (and preferably run it also in PBM).

See Also: → 1829933
Assignee: nobody → hsingh
Priority: -- → P3
See Also: → 1832639
See Also: → 1833233

Note that mozStorage does have some tests that :mak recently modernized/updated at https://searchfox.org/mozilla-central/source/storage/test/unit/test_vacuum.js although the situation is obviously a bit more complex for IDB.

One thing I was thinking was that we could potentially have telemetry for our IDB idle vacuuming and check the (local) telemetry as part of the test. I think at a high level the telemetry we'd want would be:

  • How often are we doing the vacuuming? A histogram on number of vacuums performed.
  • How many pages are we reclaiming for each high level vacuuming? A histogram on the number of pages vacuumed in total for a given database in a "session" of vacuuming. Specifically, since we take many small "bites" of the problem, we don't want to be tracking those small bites, but the total from those bites.
  • How often are our vacuums interrupted before completing / how many pages did we vacuum before we were interrupted? It might make sense to structure the prior histogram and this histogram as twins. We use the former histogram if we're able to fully complete the vacuuming, and we use this histogram if we didn't complete the vacuuming before being interrupted.
  • How long is the vacuuming taking? I think we might want 2 histograms here: 1) the time each bite takes, 2) the total time for the session (all bites for that DB for that runnable).

Adding a see-also on bug 1979997 where there was some weird corruption of the IDB database where the best explanation other than a very weird inconsistent filesystems state due to a crash (although one could still be involved) is maybe weird stuff relating to VACUUMs gone wrong.

See Also: → 1979997
You need to log in before you can comment on or make changes to this bug.