Page MenuHomePhabricator

GlobalUsage::copyLocalImagelinks deadlocks on mass delete
Closed, ResolvedPublic

Description

Deleting many similar named files at the same time causes lock contention, e.g.:

A database error has occurred. Did you forget to run maintenance/update.php after upgrading?  See: https://www.mediawiki.org/wiki/Manual:Upgrading#Run_the_update_script
Query: INSERT IGNORE INTO `globalimagelinks` (gil_wiki,gil_page,gil_page_namespace_id,gil_page_namespace,gil_page_title,gil_to) VALUES ('commonswiki','49458156','6','File','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-471237).tiff','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-4000013449).tiff'),('commonswiki','49458207','6','File','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-471237).jpg','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-4000013449).tiff'),('commonswiki','49458239','6','File','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-4000013449).jpg','DINNER_(held_by)_NORDDEUTSCHER_LLOYD_-_BREMEN_(at)_EN_ROUTE_-_S.S.BARBAROSSA_(SS)_(NYPL_Hades-276173-4000013449).tiff')
Function: GlobalUsage::copyLocalImagelinks
Error: 1213 Deadlock found when trying to get lock; try restarting transaction (10.64.16.31)

Event Timeline

aaron created this task.Jul 4 2016, 6:07 PM
Restricted Application added projects: Multimedia, Commons. · View Herald TranscriptJul 4 2016, 6:07 PM
Restricted Application added subscribers: Zppix, Steinsplitter, Aklapper. · View Herald Transcript

Change 297334 had a related patch set uploaded (by Aaron Schulz):
Defer copyLocalImagelinks() logic to avoid DB contention

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

Restricted Application added subscribers: Poyekhali, Matanya. · View Herald TranscriptJul 4 2016, 8:47 PM

Change 297334 merged by jenkins-bot:
Defer copyLocalImagelinks() logic to avoid DB contention

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

Jdforrester-WMF closed this task as Resolved.Jul 12 2016, 3:23 PM
Jdforrester-WMF triaged this task as Normal priority.

Assuming so.