Page MenuHomePhabricator

When inserting new WikiGrok claims, it throws an error if the same claim already exists
Closed, ResolvedPublic

Description

Just got the following error from the WikiGrok API on my local instance:
Function: WikiGrok\\ResponseStoreDB::insertClaims
Error: 1062 Duplicate entry '9-author-add-0hjwrvbwcbk5n7yr4311xc15z1uf9m1b' for key 'wgc_unique' ()

Event Timeline

kaldari created this task.Apr 4 2015, 12:12 AM
kaldari raised the priority of this task from to Needs Triage.
kaldari updated the task description. (Show Details)
kaldari added a project: WikiGrok.
kaldari added a subscriber: kaldari.
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 4 2015, 12:12 AM

Currently, ResponseStoreDB#store is treating claims as equal even if their actions differ. However, Claim#equals doesn't do this.

You should be able to reproduce this by submitting a "None of these" answer to WikiGrok – all claims have the "ignore" action – and then submitting a WikiGrok answer with one of the tags selected – the claim will have the "add" action.

phuedx claimed this task.Apr 13 2015, 7:55 PM
phuedx removed phuedx as the assignee of this task.Apr 13 2015, 8:22 PM

Change 203989 had a related patch set uploaded (by Kaldari):
Prevent database error resulting from duplicate unique key

https://gerrit.wikimedia.org/r/203989

Actually it looks like it was handling different action types fine (the claim key included the action). The problem was that it wasn't looking at database claim entries for statuses other than "new", so as soon as a claim reached the aggregation threshold and was applied or ignored it would then be subject to key duplication.

Change 203989 merged by jenkins-bot:
Prevent database error resulting from duplicate unique key

https://gerrit.wikimedia.org/r/203989

phuedx closed this task as Resolved.Apr 14 2015, 2:18 PM