Closed Bug 658305 Opened 13 years ago Closed 13 years ago

Use journal_size_limit on places.sqlite

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla10
Tracking Status
fennec 10+ ---

People

(Reporter: azakai, Assigned: mak)

References

Details

(Keywords: mobile)

Attachments

(1 file, 1 obsolete file)

See bug 625981 comment 66. This option will prevent the SQLite WAL file from staying too big for too long. We should use it when SQLite 3.7.7 is released and we update to it.
Depends on: SQLite3.7.7.1
Blocks: 625981
Assignee: nobody → mak77
Status: NEW → ASSIGNED
tracking-fennec: --- → ?
Keywords: mobile
Flags: in-testsuite-
Summary: Use journal_size_limit when we update to SQLite 3.7.7 → Use journal_size_limit on places.sqlite
Attached patch patch v1.0 (obsolete) — Splinter Review
This applies:
- FULL checkpointing (see http://www.sqlite.org/c3ref/wal_checkpoint_v2.html) to ensure we don't dismiss checkpoints, causing the wal journal to grow without control
- journal_size_limit (see http://www.sqlite.org/pragma.html#pragma_journal_size_limit) to ensure that after a successful checkpoint, if the journal is too large, it will be shrinked

The final situation is that we should checkpoint when the journal exceeds 512KB, and truncate the journal if it exceeds 1.5MB

I'll now take a look at bug 658303 to evaluate eventual needs, but I think for places.sqlite it won't make much difference since we have a single writable connection.
Attachment #557340 - Flags: review?(dietrich)
Comment on attachment 557340 [details] [diff] [review]
patch v1.0

Review of attachment 557340 [details] [diff] [review]:
-----------------------------------------------------------------

looks a-ok, r=me
Attachment #557340 - Flags: review?(dietrich) → review+
backed out due to strange crashes on shutdown in Reftests, exactly on threads shutdown. I suspect some blocking wal checkpoint happens really late. I'll split the patch and check both parts on Try.
tracking-fennec: ? → 9+
Try is saying me that my suspects were wrong, using blocking checkpoints is fine, while using journal_size_limit causes the intermittent crash on shutdown.  I can only guess it may be a threading issue of some sort, where it may try to truncate the file on the just merged thread.  Will require deeper investigation.
I've tried reproducing the crash on Fedora 14 and Fedora 12, using a similar mozconfig as tinderboxes and running reftests, but I have been unable to.
Now I'm trying with PGO too (at that point my config should be identical to the tinderboxes), but I'm not sure it will change anything.
Depends on: 687726
tracking-fennec: 9+ → 10+
Attached patch patch v1.1Splinter Review
This is a reduced version that just sets the size limit, I prefer waiting a bit on the blocking wal for now, since even if it's true it's pretty smart, there is still some risk that a synchronous query may hit SQLITE_BUSY, the ideal situation is where everything is async, but we are not there yet. Will file that apart.

Looks like after recent Places changes the crash disappeared, at least on Try (with some fancy trick to get pgo builds). So, I think I'll push this and keep an eye on the tree for a backout in case Try missed something.
Attachment #557340 - Attachment is obsolete: true
https://hg.mozilla.org/mozilla-central/rev/76a6531600d7
Status: ASSIGNED → RESOLVED
Closed: 13 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla10
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: