Unique constraint failures recording observer notifications in the mirror

RESOLVED DUPLICATE of bug 1472435

Status

()

defect
RESOLVED DUPLICATE of bug 1472435
Last year
11 months ago

People

(Reporter: lina, Unassigned)

Tracking

(Blocks 1 bug)

Firefox Tracking Flags

(Not tracked)

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
Reporter

Comment 1

11 months ago
(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: 11 months ago
Resolution: --- → DUPLICATE
Duplicate of bug: 1472435
You need to log in before you can comment on or make changes to this bug.