Page MenuHomePhabricator

deadlocks on INSERT IGNORE INTO wbc_entity_usage
Closed, ResolvedPublic8 Estimated Story PointsPRODUCTION ERROR

Description

Separating from T187521#4133553

commonswiki errors due to deadlocks on INSERT IGNORE INTO wbc_entity_usage seem to be common (not too worrying, but on of the most comon database errors), could the code be optimized to avoid those? I am guessing that the same row is written many times (once per change on the same item), and maybe that could be simplified somehow. INSERT IGNORE is a bit of a bad trick here, and we may be writing multiple times the same data without need. Given the changes are done by the job queue and arrive in any order, maybe transaction serialization can be relaxed?

https://logstash.wikimedia.org/goto/20defb50b256c8da0ddbf3a3bb258017

Event Timeline

jcrespo created this task.Apr 17 2018, 10:53 AM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptApr 17 2018, 10:53 AM
Lucas_Werkmeister_WMDE set the point value for this task to 8.
Restricted Application added a project: User-Ladsgroup. · View Herald TranscriptApr 17 2018, 2:31 PM

Change 427637 had a related patch set uploaded (by Ladsgroup; owner: Amir Sarabadani):
[mediawiki/extensions/Wikibase@master] Make batches in EntityUsageTable::addUsages atomic

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

Change 427637 merged by jenkins-bot:
[mediawiki/extensions/Wikibase@master] Make batches in EntityUsageTable::addUsages atomic

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

Ladsgroup closed this task as Resolved.Apr 24 2018, 12:48 PM

deadlocks are practically zero now :)

mmodell changed the subtype of this task from "Task" to "Production Error".Aug 28 2019, 11:09 PM