Open Bug 1833473 Opened 2 years ago Updated 1 year ago

Fix the use of PRAGMA incremental_vacuum

Categories

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

task

Tracking

()

People

(Reporter: janv, Unassigned)

References

Details

(Whiteboard: dom-lws-bugdash-triage)

We currently execute PRAGMA incremental_vacuum as a simple statement (ignoring any results) which leads to freeing just one page at a time. The pragma needs to be executed as a statement returning rows. See https://stackoverflow.com/questions/53746807/sqlite-incremental-vacuum-removing-only-one-free-page

So https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#7063 should be replaced with a loop which calls ExecuteStep until there are no results.

We can probably get rid of the split into 10% chunks, see https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#7009 because ExecuteStep frees one page at a time anyway and we can check for pending events in the new loop which will provide better reaction when the connection suddenly becomes active.

I also suspect that we free just one page at https://searchfox.org/mozilla-central/rev/11a4d97a7b5cdfa133f4bda4525649f651703018/dom/indexedDB/ActorsParent.cpp#13770
It seems that pragma needs to be executed using a loop and ExecuteStep as well.

Assignee: jvarga → nobody
Type: defect → task
Whiteboard: dom-lws-bugdash-triage
You need to log in before you can comment on or make changes to this bug.