Page MenuHomePhabricator

Wikibase\Client\Usage\Sql\EntityUsageTable::addUsages Deadlock
Open, LowPublic

Description

Error message
Function: Wikibase\Client\Usage\Sql\EntityUsageTable::addUsages
Error: 1213 Deadlock found when trying to get lock; try restarting transaction
Stack Trace
	#0 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1663): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1640): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1215): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(2319): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(2281): Wikimedia\Rdbms\Database->doInsertNonConflicting(string, array, string)
#5 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Usage/Sql/EntityUsageTable.php(189): Wikimedia\Rdbms\Database->insert(string, array, string, array)
#6 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Usage/Sql/SqlUsageTracker.php(184): Wikibase\Client\Usage\Sql\EntityUsageTable->addUsages(integer, array)
#7 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Store/UsageUpdater.php(82): Wikibase\Client\Usage\Sql\SqlUsageTracker->addUsedEntities(integer, array)
#8 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Store/AddUsagesForPageJob.php(122): Wikibase\Client\Store\UsageUpdater->addUsagesForPage(integer, array)
#9 /srv/mediawiki/php-1.35.0-wmf.37/extensions/EventBus/includes/JobExecutor.php(79): Wikibase\Client\Store\AddUsagesForPageJob->run()
#10 /srv/mediawiki/rpc/RunSingleJob.php(76): MediaWiki\Extension\EventBus\JobExecutor->execute(array)
#11 {main}
Impact
    1. Notes
  • Happening intermittently with low frequency.

Details

Request ID
a95f3d48-2165-4e0f-8060-013b24f55b47
Request URL
/rpc/RunSingleJob.php
Stack Trace

#0 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1663): Wikimedia\Rdbms\Database->getQueryException(string, integer, string, string)
#1 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1640): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, integer, string, string)
#2 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(1215): Wikimedia\Rdbms\Database->reportQueryError(string, integer, string, string, boolean)
#3 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(2319): Wikimedia\Rdbms\Database->query(string, string, integer)
#4 /srv/mediawiki/php-1.35.0-wmf.37/includes/libs/rdbms/database/Database.php(2281): Wikimedia\Rdbms\Database->doInsertNonConflicting(string, array, string)
#5 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Usage/Sql/EntityUsageTable.php(189): Wikimedia\Rdbms\Database->insert(string, array, string, array)
#6 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Usage/Sql/SqlUsageTracker.php(184): Wikibase\Client\Usage\Sql\EntityUsageTable->addUsages(integer, array)
#7 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Store/UsageUpdater.php(82): Wikibase\Client\Usage\Sql\SqlUsageTracker->addUsedEntities(integer, array)
#8 /srv/mediawiki/php-1.35.0-wmf.37/extensions/Wikibase/client/includes/Store/AddUsagesForPageJob.php(122): Wikibase\Client\Store\UsageUpdater->addUsagesForPage(integer, array)
#9 /srv/mediawiki/php-1.35.0-wmf.37/extensions/EventBus/includes/JobExecutor.php(79): Wikibase\Client\Store\AddUsagesForPageJob->run()
#10 /srv/mediawiki/rpc/RunSingleJob.php(76): MediaWiki\Extension\EventBus\JobExecutor->execute(array)
#11 {main}

Event Timeline

Restricted Application added a project: Platform Engineering. · View Herald TranscriptJun 17 2020, 6:49 PM
Restricted Application added a subscriber: Aklapper. · View Herald Transcript
Addshore added a subscriber: Addshore.
eprodromou triaged this task as Low priority.Jun 18 2020, 7:08 PM
eprodromou added subscribers: aaron, eprodromou.

We think this is interesting for RDBMS reasons; @aaron might be interested to look at this while on Clinic Duty. @Addshore are you working on this directly?

Krinkle added a subscriber: Krinkle.

This is related to Rdbms in the same way that it relates to PHP and MediaWiki. It uses it, but it's not where the problem is.

Still seen in current production.