Closed Bug 887868 Opened 11 years ago Closed 11 years ago

remove search.sqlite migration code

Categories

(Firefox :: Search, defect)

defect
Not set
normal

Tracking

()

RESOLVED FIXED
Firefox 28

People

(Reporter: mak, Assigned: smacleod)

References

Details

Attachments

(1 file, 6 obsolete files)

_asyncMigrateOldDB is async executing a statement created through createStatement, it should use createAsyncStatement instead, to avoid creating jank.
Assignee: nobody → smacleod
Gavin and I discussed this migration in IRC, and decided we might be able to just remove it all together. I'm going to look into whether this would be suitable.
This removes the migration from the old Search Service DB (search.sqlite) to the new JSON file. Now if the JSON file does not exist, the metadata will be initialized to an empty store.
Attachment #775872 - Flags: review?(gavin.sharp)
Hmm, can we simplify further and remove JSON_LOADING_ATTEMPTED?
Updated patch which also removes the JSON_LOADING_ATTEMPTED state.
Attachment #775872 - Attachment is obsolete: true
Attachment #775872 - Flags: review?(gavin.sharp)
Attachment #776429 - Flags: review?(gavin.sharp)
Comment on attachment 776429 [details] [diff] [review] Patch - Remove Search Service DB Migration Hmm, now I'm wondering whether we can get rid of _InitStates entirely in favor of a single "done loading" flag. Maybe that's too invasive. What do you think?
may we also remove search.sqlite in a migrateUI step?
We have bug 769557 on file for that, but I don't see that as a high priority (this database doesn't really contain any sensitive data).
Blocks: 896688
(In reply to :Gavin Sharp (use gavin@gavinsharp.com for email) from comment #5) > Hmm, now I'm wondering whether we can get rid of _InitStates entirely in > favor of a single "done loading" flag. Maybe that's too invasive. What do > you think? I spoke to Steven about this in person, he filed bug 896688 to cover this.
Comment on attachment 776429 [details] [diff] [review] Patch - Remove Search Service DB Migration >diff --git a/toolkit/components/search/nsSearchService.js b/toolkit/components/search/nsSearchService.js > } catch (ex) { > if (this._initState == engineMetadataService._InitStates.FINISHED_SUCCESS) { > // No need to pursue asynchronous initialization, > // synchronous fallback was called and has finished. > return; > } >+ // Coudln't load json, use an empty store "coudln't" typo >+ LOG("metadata init: could not load JSON file " + ex); > this._store = {}; >+ this._initState = this._InitStates.FINISHED_SUCCESS; >+ return; > } Hmm, I guess this bug existed before, but the "metadata init: complete" LOG call below won't ever be hit now because both branches return early. I think you can get rid of the returns here now, since there's no other code in the Task function. You can also put the setting of this_initState outside of the try/catch, since both paths through that set it to FINISHED_SUCCESS. >- _syncMigrateOldDB: function SRCH_SVC_EMS_migrate() { Similarly it seems like this could simplified, but we can investigate that in the followup bug.
Attachment #776429 - Flags: review?(gavin.sharp) → review+
Updated patch with small fixes from Gavin's review.
Attachment #776429 - Attachment is obsolete: true
Fixed a bug in the previous patch (case statement falling through). Tests are passing now.
Attachment #779515 - Attachment is obsolete: true
Attachment #779786 - Flags: review?(gavin.sharp)
Summary: _asyncMigrateOldDB is using the wrong statement type → remove search.sqlite migration code
Comment on attachment 779786 [details] [diff] [review] Patch - Remove Search Service DB Migration r=me, but I'll attach a supplemental patch on top of this that address a minor nit (seemed easier than explaining it)
Attachment #779786 - Flags: review?(gavin.sharp) → review+
Attached patch nit fix (obsolete) — Splinter Review
Attachment #780013 - Flags: feedback?(smacleod)
Comment on attachment 780013 [details] [diff] [review] nit fix Review of attachment 780013 [details] [diff] [review]: ----------------------------------------------------------------- Looks good to me, more clear.
Attachment #780013 - Flags: feedback?(smacleod) → feedback+
Rolled Gavin's nit fix into the patch
Attachment #779786 - Attachment is obsolete: true
Attachment #780013 - Attachment is obsolete: true
Status: NEW → ASSIGNED
Keywords: checkin-needed
OS: Mac OS X → All
Hardware: x86 → All
Target Milestone: --- → Firefox 25
Status: ASSIGNED → RESOLVED
Closed: 11 years ago
Resolution: --- → FIXED
Depends on: 898713
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
FWIW, this still does reproduce easily on Try with bug 873378 re-landed. https://tbpl.mozilla.org/?tree=Try&rev=1aaf8295268a
Now that bug 914437 (and thus bug 896054) is fixed, we should be clear to land this again!
Attachment #780494 - Attachment is obsolete: true
Keywords: checkin-needed
Status: REOPENED → RESOLVED
Closed: 11 years ago11 years ago
Resolution: --- → FIXED
Target Milestone: --- → Firefox 28
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: