Closed
Bug 1173627
Opened 9 years ago
Closed 9 years ago
Checkpoint the WAL after creating or updating tables.
Categories
(Firefox for iOS :: Data Storage, defect)
Tracking
()
RESOLVED
FIXED
People
(Reporter: rnewman, Assigned: rnewman)
Details
Attachments
(1 file)
No description provided.
Assignee | ||
Comment 1•9 years ago
|
||
Attachment #8620727 -
Flags: review?(sleroux)
Assignee | ||
Comment 2•9 years ago
|
||
This PR does two things: * We checkpoint immediately after futzing with tables. This gets the result out of the WAL and into the main DB structure, which can only be a good thing, and will help to keep the WAL small. * We finalize statements as soon as we're done with them, rather than waiting for the deinitializer to run. Shorter lifespans are nice.
Assignee | ||
Comment 3•9 years ago
|
||
As a follow-up we should consider checkpointing manually when it's convenient. We'll probably do so after each sync.
Updated•9 years ago
|
Attachment #8620727 -
Flags: review?(sleroux) → review+
Comment 4•9 years ago
|
||
I haven't used WAL journaling before but it looks interesting. From what I read, instead of performing transactions to the DB directly and have a fallback, commits are written to the WAL file and then when a checkpoint is reached or invoked, the WAL is written to the DB. Is that correct? I won't hijack this bug for this discussion but I'd be interested in learning more about this.
Assignee | ||
Comment 5•9 years ago
|
||
Pretty much. Writers write to the WAL, not directly to the DB file; this buys some concurrency and some more resilience. After some amount of writing, the WAL is checkpointed, which involves replaying some or all of it directly into the DB. It's hard to describe it better than sqlite's docs do: https://www.sqlite.org/wal.html Main concerns with the WAL are the cost of futzing with a large one next time you open the DB, and the size it can occupy on disk -- without taking some care, it can temporarily bloat, and it won't be resized down.
Assignee | ||
Comment 6•9 years ago
|
||
https://github.com/mozilla/firefox-ios/commit/608d139a4e81456ac95550ca40a47b95fb35362e
Status: ASSIGNED → RESOLVED
Closed: 9 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•