Closed Bug 516932 Opened 15 years ago Closed 15 years ago

Add an advanced maintainance task to vacuum and check integrity, for support purposes.

Categories

(Toolkit :: Places, defect)

defect
Not set
normal

Tracking

()

VERIFIED FIXED
mozilla1.9.3a1
Tracking Status
status1.9.2 --- beta1-fixed

People

(Reporter: mak, Assigned: mak)

Details

(Keywords: verified1.9.2)

Attachments

(1 file, 3 obsolete files)

We often have to point people to how vacuum or check integrity on their database, we could just add an additional method to PlacesDBUtils, and point people to run that method in the error console.

It would run an integrity check, reporting results in the console, and eventually a REINDEX if the integrity check fails. Then it would run a vacuum.

Eventually in future this could even be added to a button in the new about:support page.

Notice this would never be run automatically.
Assignee: nobody → mak77
Attached patch patch v1.0 (obsolete) — Splinter Review
Attached patch patch v1.1 (obsolete) — Splinter Review
this is just reporting results to the console, for 1.9.2 we can't take string changes, so i'd go for a simple solution like this, just to be able to tell users to activate this in the Error Console and see if reported bugs could be due to corruption or lack of vacuuming.
This still needs some db stat, i could integrate part of places stats project, to print most important stats, and db file size (also before/after vacuum so we can guess if vacuum is running too rarely).
As a test i'll just check it does not throw, and does not apply corrupt tasks to a sane db.
in a followup we can hook this into about:support and create a better formatted report.
Attachment #403498 - Attachment is obsolete: true
Attached patch patch v1.2 (obsolete) — Splinter Review
this is something we can take on 1.9.2, integration with about:support can be done in a followup (due to passed string freeze).
The method just returns a string with informations and simple labels, that is printed in the error console on eval, user can just copy it and paste into support forum or in a bug.
For support purposes i think we just need size of the db and number of entries per table. Any other statistic purpose is better covered by the stats project.

the full command to paste in the error console will be:
Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
PlacesDBUtils.checkDatabase();
Attachment #403619 - Attachment is obsolete: true
Attachment #403784 - Flags: review?(dietrich)
Flags: in-testsuite?
Comment on attachment 403784 [details] [diff] [review]
patch v1.2

s/MAINTANANCE/MAINTENANCE/

i'm a little worried that the name is too innocuous. since it actually will take steps to *fix* the database, you should name the function so that is clear. or have the fix part be an bool param.

r=me w/ these fixed.
Attachment #403784 - Flags: review?(dietrich) → review+
well yeah, i backup the db in case of a fix
a bool param would work but you know, users just search for fixes in forums and around, and they don't ask themselves what (TRUE) means as a param.
I should probably split into CheckDatabase and CheckAndFixDatabase to hide the bool param.
otherwise just make this checkAndFixDatabase... since even the check will at least execute vacuum and cleanup.
Attached patch patch v1.3Splinter Review
gone for PlacesDBUtils.checkAndFixDatabase(); based on IRC discussion with dietrich.
Attachment #403784 - Attachment is obsolete: true
http://hg.mozilla.org/mozilla-central/rev/77e5bfb0ef73
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla1.9.3a1
Flags: in-testsuite? → in-testsuite+
OS: Windows Vista → All
Hardware: x86 → All
To actually use this:

Open error console, in the eval field paste the following code and click Eval:
Components.utils.import("resource://gre/modules/PlacesDBUtils.jsm");
PlacesDBUtils.checkAndFixDatabase();

paste the output message to a bug if it's returning a corrupt database.
Comment on attachment 404581 [details] [diff] [review]
patch v1.3

low risk, high help for support, with test. i think this should really make 1.9.2.
Attachment #404581 - Flags: approval1.9.2?
Comment on attachment 404581 [details] [diff] [review]
patch v1.3

low risk, high value to support, and has tests -> a+.
Attachment #404581 - Flags: approval1.9.2? → approval1.9.2+
Verified fixed on trunk and 1.9.2 with:

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.3a1pre) Gecko/20091016 Minefield/3.7a1pre ID:20091016035239

Mozilla/5.0 (Macintosh; U; Intel Mac OS X 10.5; en-US; rv:1.9.2b1pre) Gecko/20091014 Namoroka/3.6b1pre ID:20091014033739
Status: RESOLVED → VERIFIED
Keywords: verified1.9.2
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: