Seen in this gate-and-submit build for this Gerrit change:
mw-dberror.log:Fri Sep 6 13:54:45 UTC 2024 a6cfaed359e0 wikidb Error 1213 from MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob::run, Deadlock found when trying to get lock; try restarting transaction INSERT INTO `cuci_user` (ciu_timestamp,ciu_ciwm_id,ciu_central_id) VALUES ('20240906135443',1,92) ON DUPLICATE KEY UPDATE ciu_timestamp = '20240906135443' localhost:/workspace/db/quibble-mysql-y0boxzq3/socket mw-dberror.log:#0 /workspace/src/includes/libs/rdbms/database/Database.php(1151): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string) mw-dberror.log:#1 /workspace/src/includes/libs/rdbms/database/Database.php(643): Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool) mw-dberror.log:#2 /workspace/src/includes/libs/rdbms/database/DatabaseMySQL.php(542): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string) mw-dberror.log:#3 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(127): Wikimedia\Rdbms\DatabaseMySQL->upsert(string, array, array, array, string) mw-dberror.log:#4 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(567): Wikimedia\Rdbms\DBConnRef->__call(string, array) mw-dberror.log:#5 /workspace/src/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(340): Wikimedia\Rdbms\DBConnRef->upsert(string, array, array, array, string) mw-dberror.log:#6 /workspace/src/extensions/CheckUser/src/Jobs/UpdateUserCentralIndexJob.php(60): Wikimedia\Rdbms\InsertQueryBuilder->execute() mw-dberror.log:#7 /workspace/src/includes/jobqueue/JobRunner.php(369): MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob->run() mw-dberror.log:#8 /workspace/src/includes/jobqueue/JobRunner.php(330): JobRunner->doExecuteJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-dberror.log:#9 /workspace/src/includes/jobqueue/JobRunner.php(225): JobRunner->executeJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-dberror.log:#10 /workspace/src/includes/specials/SpecialRunJobs.php(136): JobRunner->run(array) mw-dberror.log:#11 /workspace/src/includes/specials/SpecialRunJobs.php(121): MediaWiki\Specials\SpecialRunJobs->doRun(array) mw-dberror.log:#12 /workspace/src/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialRunJobs->execute(null) mw-dberror.log:#13 /workspace/src/includes/specialpage/SpecialPageFactory.php(1708): MediaWiki\SpecialPage\SpecialPage->run(null) mw-dberror.log:#14 /workspace/src/includes/actions/ActionEntryPoint.php(502): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext) mw-dberror.log:#15 /workspace/src/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest() mw-dberror.log:#16 /workspace/src/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() mw-dberror.log:#17 /workspace/src/index.php(58): MediaWiki\MediaWikiEntryPoint->run() mw-dberror.log:#18 {main} mw-dberror.log:Fri Sep 6 13:59:10 UTC 2024 a6cfaed359e0 wikidb Error 1213 from MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob::run, Deadlock found when trying to get lock; try restarting transaction INSERT INTO `cuci_user` (ciu_timestamp,ciu_ciwm_id,ciu_central_id) VALUES ('20240906135836',1,1086) ON DUPLICATE KEY UPDATE ciu_timestamp = '20240906135836' localhost:/workspace/db/quibble-mysql-y0boxzq3/socket mw-dberror.log:#0 /workspace/src/includes/libs/rdbms/database/Database.php(1151): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string) mw-dberror.log:#1 /workspace/src/includes/libs/rdbms/database/Database.php(643): Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool) mw-dberror.log:#2 /workspace/src/includes/libs/rdbms/database/DatabaseMySQL.php(542): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string) mw-dberror.log:#3 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(127): Wikimedia\Rdbms\DatabaseMySQL->upsert(string, array, array, array, string) mw-dberror.log:#4 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(567): Wikimedia\Rdbms\DBConnRef->__call(string, array) mw-dberror.log:#5 /workspace/src/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(340): Wikimedia\Rdbms\DBConnRef->upsert(string, array, array, array, string) mw-dberror.log:#6 /workspace/src/extensions/CheckUser/src/Jobs/UpdateUserCentralIndexJob.php(60): Wikimedia\Rdbms\InsertQueryBuilder->execute() mw-dberror.log:#7 /workspace/src/includes/jobqueue/JobRunner.php(369): MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob->run() mw-dberror.log:#8 /workspace/src/includes/jobqueue/JobRunner.php(330): JobRunner->doExecuteJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-dberror.log:#9 /workspace/src/includes/jobqueue/JobRunner.php(225): JobRunner->executeJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-dberror.log:#10 /workspace/src/includes/specials/SpecialRunJobs.php(136): JobRunner->run(array) mw-dberror.log:#11 /workspace/src/includes/specials/SpecialRunJobs.php(121): MediaWiki\Specials\SpecialRunJobs->doRun(array) mw-dberror.log:#12 /workspace/src/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialRunJobs->execute(null) mw-dberror.log:#13 /workspace/src/includes/specialpage/SpecialPageFactory.php(1708): MediaWiki\SpecialPage\SpecialPage->run(null) mw-dberror.log:#14 /workspace/src/includes/actions/ActionEntryPoint.php(502): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext) mw-dberror.log:#15 /workspace/src/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest() mw-dberror.log:#16 /workspace/src/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() mw-dberror.log:#17 /workspace/src/index.php(58): MediaWiki\MediaWikiEntryPoint->run() mw-dberror.log:#18 {main} mw-error.log:2024-09-06 13:54:45 a6cfaed359e0 wikidb: [d53cbb1f3391b32aca6c1e40] /index.php Wikimedia\Rdbms\DBQueryError: Error 1213: Deadlock found when trying to get lock; try restarting transaction mw-error.log:Function: MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob::run mw-error.log:Query: INSERT INTO `cuci_user` (ciu_timestamp,ciu_ciwm_id,ciu_central_id) VALUES ('20240906135443',1,92) ON DUPLICATE KEY UPDATE ciu_timestamp = '20240906135443' mw-error.log:#0 /workspace/src/includes/libs/rdbms/database/Database.php(1177): Wikimedia\Rdbms\Database->getQueryException(string, int, string, string) mw-error.log:#1 /workspace/src/includes/libs/rdbms/database/Database.php(1151): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string) mw-error.log:#2 /workspace/src/includes/libs/rdbms/database/Database.php(643): Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool) mw-error.log:#3 /workspace/src/includes/libs/rdbms/database/DatabaseMySQL.php(542): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string) mw-error.log:#4 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(127): Wikimedia\Rdbms\DatabaseMySQL->upsert(string, array, array, array, string) mw-error.log:#5 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(567): Wikimedia\Rdbms\DBConnRef->__call(string, array) mw-error.log:#6 /workspace/src/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(340): Wikimedia\Rdbms\DBConnRef->upsert(string, array, array, array, string) mw-error.log:#7 /workspace/src/extensions/CheckUser/src/Jobs/UpdateUserCentralIndexJob.php(60): Wikimedia\Rdbms\InsertQueryBuilder->execute() mw-error.log:#8 /workspace/src/includes/jobqueue/JobRunner.php(369): MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob->run() mw-error.log:#9 /workspace/src/includes/jobqueue/JobRunner.php(330): JobRunner->doExecuteJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-error.log:#10 /workspace/src/includes/jobqueue/JobRunner.php(225): JobRunner->executeJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-error.log:#11 /workspace/src/includes/specials/SpecialRunJobs.php(136): JobRunner->run(array) mw-error.log:#12 /workspace/src/includes/specials/SpecialRunJobs.php(121): MediaWiki\Specials\SpecialRunJobs->doRun(array) mw-error.log:#13 /workspace/src/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialRunJobs->execute(null) mw-error.log:#14 /workspace/src/includes/specialpage/SpecialPageFactory.php(1708): MediaWiki\SpecialPage\SpecialPage->run(null) mw-error.log:#15 /workspace/src/includes/actions/ActionEntryPoint.php(502): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext) mw-error.log:#16 /workspace/src/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest() mw-error.log:#17 /workspace/src/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() mw-error.log:#18 /workspace/src/index.php(58): MediaWiki\MediaWikiEntryPoint->run() mw-error.log:#19 {main} mw-error.log:2024-09-06 13:59:10 a6cfaed359e0 wikidb: [bbc7172e4b3a78e2b00ac367] /index.php Wikimedia\Rdbms\DBQueryError: Error 1213: Deadlock found when trying to get lock; try restarting transaction mw-error.log:Function: MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob::run mw-error.log:Query: INSERT INTO `cuci_user` (ciu_timestamp,ciu_ciwm_id,ciu_central_id) VALUES ('20240906135836',1,1086) ON DUPLICATE KEY UPDATE ciu_timestamp = '20240906135836' mw-error.log:#0 /workspace/src/includes/libs/rdbms/database/Database.php(1177): Wikimedia\Rdbms\Database->getQueryException(string, int, string, string) mw-error.log:#1 /workspace/src/includes/libs/rdbms/database/Database.php(1151): Wikimedia\Rdbms\Database->getQueryExceptionAndLog(string, int, string, string) mw-error.log:#2 /workspace/src/includes/libs/rdbms/database/Database.php(643): Wikimedia\Rdbms\Database->reportQueryError(string, int, string, string, bool) mw-error.log:#3 /workspace/src/includes/libs/rdbms/database/DatabaseMySQL.php(542): Wikimedia\Rdbms\Database->query(Wikimedia\Rdbms\Query, string) mw-error.log:#4 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(127): Wikimedia\Rdbms\DatabaseMySQL->upsert(string, array, array, array, string) mw-error.log:#5 /workspace/src/includes/libs/rdbms/database/DBConnRef.php(567): Wikimedia\Rdbms\DBConnRef->__call(string, array) mw-error.log:#6 /workspace/src/includes/libs/rdbms/querybuilder/InsertQueryBuilder.php(340): Wikimedia\Rdbms\DBConnRef->upsert(string, array, array, array, string) mw-error.log:#7 /workspace/src/extensions/CheckUser/src/Jobs/UpdateUserCentralIndexJob.php(60): Wikimedia\Rdbms\InsertQueryBuilder->execute() mw-error.log:#8 /workspace/src/includes/jobqueue/JobRunner.php(369): MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob->run() mw-error.log:#9 /workspace/src/includes/jobqueue/JobRunner.php(330): JobRunner->doExecuteJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-error.log:#10 /workspace/src/includes/jobqueue/JobRunner.php(225): JobRunner->executeJob(MediaWiki\CheckUser\Jobs\UpdateUserCentralIndexJob) mw-error.log:#11 /workspace/src/includes/specials/SpecialRunJobs.php(136): JobRunner->run(array) mw-error.log:#12 /workspace/src/includes/specials/SpecialRunJobs.php(121): MediaWiki\Specials\SpecialRunJobs->doRun(array) mw-error.log:#13 /workspace/src/includes/specialpage/SpecialPage.php(719): MediaWiki\Specials\SpecialRunJobs->execute(null) mw-error.log:#14 /workspace/src/includes/specialpage/SpecialPageFactory.php(1708): MediaWiki\SpecialPage\SpecialPage->run(null) mw-error.log:#15 /workspace/src/includes/actions/ActionEntryPoint.php(502): MediaWiki\SpecialPage\SpecialPageFactory->executePath(string, MediaWiki\Context\RequestContext) mw-error.log:#16 /workspace/src/includes/actions/ActionEntryPoint.php(145): MediaWiki\Actions\ActionEntryPoint->performRequest() mw-error.log:#17 /workspace/src/includes/MediaWikiEntryPoint.php(200): MediaWiki\Actions\ActionEntryPoint->execute() mw-error.log:#18 /workspace/src/index.php(58): MediaWiki\MediaWikiEntryPoint->run() mw-error.log:#19 {main}
Occasional CI failures due to deadlocks are nothing new, but as this is a relatively new table (T373018) and a risk of deadlocks was already mentioned (T368151#9921298), this still seems worth investigating.