Closed Bug 406865 Opened 17 years ago Closed 17 years ago

need to clobber broken urlclassifier3.sqlite files

Categories

(Toolkit :: Safe Browsing, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED

People

(Reporter: dcamp, Assigned: dcamp)

References

Details

Attachments

(1 file, 1 obsolete file)

Attached patch clobber out-of-date databases (obsolete) — Splinter Review
Bugs 406621 and 406856 will have left some expired blacklist entries in the database.

Additionally, apparently sometime in early November google reset their database, which will have left a lot of databases in an inconsistent state.

The attached patch will clobber any database created by the old builds, and start updating fresh.  We should land this once 406856 lands.
Attachment #291524 - Flags: review?(tony)
The google people Might be doing one more database rebuild sometime this week.  If they decide to do that, we should wait to land this patch until they've done that.

After that, we need google to rarely-if-ever reset the database again, and build a good way to recover from resets into the protocol (rather than just leaving databases in an inconsistent state).
Flags: blocking-firefox3?
Comment on attachment 291524 [details] [diff] [review]
clobber out-of-date databases

>+  if (databaseVersion != IMPLEMENTATION_VERSION) {
>+    LOG(("Incompatible database, removing."));
>+
>+    rv = connection->Close();
>+    NS_ENSURE_SUCCESS(rv, rv);
>+
>+    rv = mDBFile->Remove(PR_FALSE);
>+    NS_ENSURE_SUCCESS(rv, rv);
>+
>+    rv = storageService->OpenDatabase(mDBFile, getter_AddRefs(connection));
>+    NS_ENSURE_SUCCESS(rv, rv);
>+  }
>+
>+  rv = connection->SetSchemaVersion(IMPLEMENTATION_VERSION);
>+  NS_ENSURE_SUCCESS(rv, rv);

Can we put the SetSchemaVersion in the if block?

The rest looks good.
Attachment #291524 - Flags: review?(tony) → review+
Attached patch v2Splinter Review
new version doesn't check the schema on a newly-created database.
Attachment #291524 - Attachment is obsolete: true
Attachment #291548 - Flags: review?(tony)
Comment on attachment 291548 [details] [diff] [review]
v2

Yeah, I like this better.
Attachment #291548 - Flags: review?(tony) → review+
Comment on attachment 291548 [details] [diff] [review]
v2

Google isn't going to be rebuilding their database, so this should be ready to land.
Attachment #291548 - Flags: approval1.9?
Attachment #291548 - Flags: approval1.9? → approval1.9+
Checking in src/nsUrlClassifierDBService.cpp;
/cvsroot/mozilla/toolkit/components/url-classifier/src/nsUrlClassifierDBService.cpp,v  <--  nsUrlClassifierDBService.cpp
new revision: 1.44; previous revision: 1.43
done
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
dave, this should indirectly fix that bug polvi was seeing, right?  (bug #406505)
Flags: blocking-firefox3? → blocking-firefox3+
Product: Firefox → Toolkit
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: