Page MenuHomePhabricator

TermSqlCache deadlocks
Closed, ResolvedPublic

Description

I'm seeing this kind of error in the logs with modest frequency (some hours there are a lot and others not many):

wikidatawiki Wikibase\TermSqlCache::saveTermsOfEntity 10.0.6.44 1213 Deadlock found when trying to get lock; try restarting transaction (10.0.6.44) INSERT INTO wb_terms (term_language,term_type,term_text,term_entity_id,term_entity_type) VALUES ('de','label','Ylläsjoki','202119','item')


Version: master
Severity: critical

Details

Reference
bz42547

Event Timeline

bzimport raised the priority of this task from to High.Nov 22 2014, 1:06 AM
bzimport set Reference to bz42547.

2012-12-03 10:10:41 mw62 wikidatawiki: #0 /usr/local/apache/common-local/php-1.21wmf5/includes/db/Database.php(962): DatabaseBase->reportQueryError('Deadlock found ...', 1213, 'INSERT INTO `w...', 'Wikibase\TermSq...', false)
#1 /usr/local/apache/common-local/php-1.21wmf5/includes/db/Database.php(1720): DatabaseBase->query('INSERT INTO `w...', 'Wikibase\TermSq...')
#2 /usr/local/apache/common-local/php-1.21wmf5/extensions/Wikibase/repo/includes/store/sql/TermSqlCache.php(91): DatabaseBase->insert('wb_terms', Array, 'Wikibase\TermSq...')
#3 /usr/local/apache/common-local/php-1.21wmf5/extensions/Wikibase/repo/includes/updates/EntityModificationUpdate.php(76): Wikibase\TermSqlCache->saveTermsOfEntity(Object(Wikibase\ItemObject))
#4 /usr/local/apache/common-local/php-1.21wmf5/includes/DataUpdate.php(100): Wikibase\EntityModificationUpdate->doUpdate()
#5 /usr/local/apache/common-local/php-1.21wmf5/includes/WikiPage.php(2047): DataUpdate::runUpdates(Array)
#6 /usr/local/apache/common-local/php-1.21wmf5/includes/WikiPage.php(1884): WikiPage->doEditUpdates(Object(Revision), Object(User), Array)
#7 /usr/local/apache/common-local/php-1.21wmf5/extensions/Wikibase/repo/includes/content/EntityContent.php(397): WikiPage->doEditContent(Object(Wikibase\ItemContent), '/* wbsetentity ...', 81, 0, Object(User))
#8 /usr/local/apache/common-local/php-1.21wmf5/extensions/Wikibase/repo/includes/EditEntity.php(491): Wikibase\EntityContent->save('/* wbsetentity ...', Object(User), 81, 0, Object(Wikibase\EditEntity))
#9 /usr/local/apache/common-local/php-1.21wmf5/extensions/Wikibase/repo/includes/api/ApiModifyEntity.php(238): Wikibase\EditEntity->attemptSave('/* wbsetentity ...', 17, 'd55aee68b8d2da7...')
#10 /usr/local/apache/common-local/php-1.21wmf5/includes/api/ApiMain.php(825): Wikibase\ApiModifyEntity->execute()
#11 /usr/local/apache/common-local/php-1.21wmf5/includes/api/ApiMain.php(372): ApiMain->executeAction()
#12 /usr/local/apache/common-local/php-1.21wmf5/includes/api/ApiMain.php(349): ApiMain->executeActionWithErrorHandling()
#13 /usr/local/apache/common-local/php-1.21wmf5/api.php(77): ApiMain->execute()
#14 /usr/local/apache/common-local/live-1.5/api.php(3): require('/usr/local/apac...')
#15 {main}

Reedy says we are still getting these errors.

Thu Dec 6 21:50:03 UTC 2012 srv257 wikidatawiki Wikibase\TermSqlCache::saveTermsOfEntity 10.0.6.44 1213 Deadlock found when trying to get lock; try restarting

transaction (10.0.6.44)  INSERT  INTO `wb_terms` (term_language,term_type,term_text,term_entity_id,term_entity_type) VALUES ('eo','label','Kalvinana preÄ
  • Bug 42798 has been marked as a duplicate of this bug. ***

This is kind of a big deal to leave like this. Who is working on this, and what's the status?

@Rob: I'm working on it. Upping prio.

Change I2e8d2fa7: (bug 42547) avoid deadlocks by using retry loop

Change I442ee8df: (bug 42547) don't re-save terms if nothing changed

Verified in Wikidata demo sprint 26