Closed Bug 1471988 Opened 2 years ago Closed 2 years ago

Unique constraint failures recording observer notifications in the mirror

Categories

(Firefox :: Sync, defect)

defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 1472435

People

(Reporter: lina, Unassigned)

References

(Blocks 1 open bug)

Details

The most frequent errors in event telemetry so far, excluding "database disk image malformed" (which we can't do much about if they affect the main Places database), are:

> Error(s) encountered during statement execution: UNIQUE constraint failed: itemsChang
> Error(s) encountered during statement execution: UNIQUE constraint failed: guidsChang
> Error(s) encountered during statement execution: UNIQUE constraint failed: itemsAdded

So we're trying to record observer notifications for items that we've already processed. My first guess is deduping...the `mergeStates` table has `PRIMARY KEY(localGuid, mergedGuid)`, so it's possible to insert duplicate local and remote GUIDs, as long as their corresponding remote or local GUIDs are different. (We also don't assert that the merged tree is duplicate-free, though we do when we build the local and remote trees, in https://searchfox.org/mozilla-central/rev/d2966246905102b36ef5221b0e3cbccf7ea15a86/toolkit/components/places/SyncedBookmarksMirror.jsm#3149-3154).

This could also be related to bug 1423418, where an incorrectly parented root causes us to walk its children multiple times. Though, unlike `PlacesSyncUtils.bookmarks.pullChanges`, the query we use to build the local tree starts at the Places root, not the content roots (https://searchfox.org/mozilla-central/rev/d2966246905102b36ef5221b0e3cbccf7ea15a86/toolkit/components/places/SyncedBookmarksMirror.jsm#100-101).

The `itemsAdded` error is especially interesting: since its primary key is `guid`, the same (remote-only) item must be duplicated in `mergeStates`.
See Also: → 1472241
(In reply to Lina Cambridge (she/her) [:lina, :kitcambridge] from comment #0)
> My first guess is deduping...the `mergeStates` table has
> `PRIMARY KEY(localGuid, mergedGuid)`, so it's possible to insert duplicate
> local and remote GUIDs, as long as their corresponding remote or local GUIDs
> are different.
> 
> This could also be related to bug 1423418, where an incorrectly parented
> root causes us to walk its children multiple times.

Both are unlikely given the log in bug 1472435, where there's no deduping, and no duplicates in the merge tree. Waiting to hear back from Tortino for additional logs in that bug, so duping this over.
Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1472435
You need to log in before you can comment on or make changes to this bug.