Closed Bug 434805 Opened 17 years ago Closed 16 years ago

work harder to recover from url-classifier db corruption

Categories

(Toolkit :: Safe Browsing, defect)

3.0 Branch
defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dcamp, Assigned: dcamp)

Details

(Keywords: fixed1.9.0.2)

Attachments

(1 file, 2 obsolete files)

Attached patch v1 (obsolete) (deleted) — Splinter Review
The url-classifier relies on synchronous=OFF to get decent update performance on its large transactions. This opens up the possibility of db corruption in the case of a badly-timed power failure. There's no user data lost, we just need to rebuild the db from the server. Right now we only reset the db if the corruption is detected when the database is open, which isn't always the case. Attached patch will recover from corruption detected during the update or lookup process. As it stands right now, if corruption is detected during the update/lookup processes, the update/lookup will fail silently, and it won't fix itself.
Flags: blocking-firefox3?
Attachment #321795 - Flags: review?(tony)
Whiteboard: [RC2?]
Comment on attachment 321795 [details] [diff] [review] v1 Looks ok, but wouldn't it be easier to just do a test lookup after the open to see if the table is corrupt and reset at that point? This change seems a lot more invasive.
Attachment #321795 - Flags: review?(tony) → review+
A single lookup isn't guaranteed to come across any given corrupted page. Between all lookups and updates, though, we should detect corruption reasonably quickly.
I see, I guess we could scan all the tables at startup, but that sounds worse. Ok, seems like the better approach.
Flags: blocking1.9.0.1+
Flags: blocking-firefox3?
Flags: blocking-firefox3-
Whiteboard: [RC2?] → [RC2-]
Assignee: nobody → dcamp
Version: unspecified → 3.0 Branch
Comment on attachment 321795 [details] [diff] [review] v1 OK, so there's a simpler way to do this. After corruption is detected, every major call to sqlite functions returns SQLITE_CORRUPT. So we shouldn't really have to do all this weird propagation/saving, we can just check lastError at the end of an update process. Patch coming up...
Attachment #321795 - Attachment is obsolete: true
I actually don't think this blocks based on the impact analysis in comment 0, but no reason why we shouldn't take the patch. Do we need bake-time on mozilla-central first?
Flags: wanted1.9.0.x+
Flags: blocking1.9.0.1-
Flags: blocking1.9.0.1+
Whiteboard: [RC2-]
Attached patch better fix (obsolete) (deleted) — Splinter Review
This fix is a lot simpler.
Attachment #326625 - Flags: review?(tony)
Comment on attachment 326625 [details] [diff] [review] better fix looks good; r+
Attachment #326625 - Flags: review?(tony) → review+
Pushed to mozilla-central as changeset caeba7562e49.
Attachment #326625 - Flags: approval1.9.0.1?
Oops, this doesn't build on windows, backed out until I can find the right way to fix it.
Attachment #326625 - Flags: approval1.9.0.1?
Attached patch updated patch. (deleted) — Splinter Review
Updated patch, was missing a REQUIRES.
Attachment #326625 - Attachment is obsolete: true
Pushed to mozilla-central as df6e6f3ac380
Status: NEW → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Comment on attachment 333897 [details] [diff] [review] updated patch. Lost my approval flag with the updated patch...
Attachment #333897 - Flags: approval1.9.0.2?
Comment on attachment 333897 [details] [diff] [review] updated patch. Approved for 1.9.0.2. Please land in CVS. a=ss
Attachment #333897 - Flags: approval1.9.0.2? → approval1.9.0.2+
Flags: in-testsuite?
cvsroot/mozilla/toolkit/components/url-classifier/src/Makefile.in,v <-- Makefile.in new revision: 1.22; previous revision: 1.21 done Checking in src/nsUrlClassifierDBService.cpp; /cvsroot/mozilla/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp,v <-- nsUrlClassifierDBService.cpp new revision: 1.80; previous revision: 1.79 done
Keywords: fixed1.9.0.2
Flags: in-testsuite? → in-testsuite-
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: