Page MenuHomePhabricator

Lock wait timeout exceeded (WikiPage::insertRedirectEntry) when editing a self-redirecting template
Open, HighPublic

Description

Template page https://gl.wikipedia.org/wiki/Modelo:ZWEb was overwritten with another redirect template that was pointing to it. We cannot undo the self-redirect now, any edit/move/delete attempt results in below error:

A database query error has occurred. This may indicate a bug in the software.

Function: WikiPage::insertRedirectEntry
Error: 1205 Lock wait timeout exceeded; try restarting transaction (10.64.16.27)

Page history: https://gl.wikipedia.org/w/index.php?title=Modelo:ZWEb&action=history

Event Timeline

Banjo created this task.Dec 2 2015, 10:39 PM
Banjo raised the priority of this task from to Needs Triage.
Banjo updated the task description. (Show Details)
Banjo added a project: MediaWiki-Templates.
Banjo added a subscriber: Banjo.
Restricted Application added subscribers: StudiesWorld, Aklapper. · View Herald TranscriptDec 2 2015, 10:39 PM
Jdforrester-WMF triaged this task as High priority.Dec 2 2015, 10:44 PM
Jdforrester-WMF added a subscriber: Jdforrester-WMF.

This is… surprising, and not good.

Banjo added a comment.Dec 2 2015, 10:47 PM

fixed it, I had to do the following:

Merge history of https://gl.wikipedia.org/wiki/Modelo:ZWEb to https://gl.wikipedia.org/wiki/Modelo:ZIMb
Edit https://gl.wikipedia.org/wiki/Modelo:ZIMb removing the redirect text
Moving https://gl.wikipedia.org/wiki/Modelo:ZIMb to https://gl.wikipedia.org/wiki/Modelo:ZWEb

No actions needed on our side, this should sort it out. Let me know if you need further details for any tests or further investigation you want to perform.

Jackmcbarn renamed this task from Template page with self redirect cannot be edited to Lock wait timeout exceeded when editing a self-redirecting template.Dec 4 2015, 3:14 AM
Jackmcbarn added a project: MediaWiki-Database.
aaron merged a task: Restricted Task.Dec 8 2015, 11:04 PM
aaron added subscribers: aaron, Bawolff, Hanay and 2 others.
jcrespo added a subscriber: jcrespo.Dec 9 2015, 5:32 PM

Lock wait timout DB errors happening involving self-redirects https://logstash.wikimedia.org/#dashboard/temp/AVGHw67XptxhN1Xaw2uo

Krinkle renamed this task from Lock wait timeout exceeded when editing a self-redirecting template to Lock wait timeout exceeded (WikiPage::insertRedirectEntry) when editing a self-redirecting template.Aug 4 2018, 4:52 PM
Krinkle added a subscriber: Krinkle.Oct 4 2018, 7:42 PM

Still seen on 1.32.0-wmf.24.

Query: INSERT INTO `redirect` (rd_from,rd_namespace,rd_title,rd_fragment,rd_interwiki) VALUES ('#######','3','###','','') ON DUPLICATE KEY UPDATE rd_namespace = '3',rd_title = '###',rd_fragment = '',rd_interwiki = ''
Function: WikiPage::insertRedirectEntry
Error: 1205 Lock wait timeout exceeded; try restarting transaction


Exception executing job: LocalPageMoveJob LocalRenameUserJob from=#### new=[3,"###"] old=[3,"####"] renamer=##### requestId=W7ZqqgrAADQAAGD8BUoAAAAN session={"headers":"array(...)","ip":"########","sessionId":"","userId":0} suppressredirects= to=### : 

Wikimedia\Rdbms\DBQueryError: A database query error has occurred.
trace
#2 /srv/mediawiki/php-1.32.0-wmf.24/includes/libs/rdbms/database/DatabaseMysqlBase.php(1367): Wikimedia\Rdbms\Database->query(string, string)
#3 /srv/mediawiki/php-1.32.0-wmf.24/includes/page/WikiPage.php(1057): Wikimedia\Rdbms\DatabaseMysqlBase->upsert(string, array, array, array, string)
#4 /srv/mediawiki/php-1.32.0-wmf.24/includes/page/WikiPage.php(1430): WikiPage->insertRedirectEntry(Title)
#5 /srv/mediawiki/php-1.32.0-wmf.24/includes/page/WikiPage.php(1389): WikiPage->updateRedirectOn(Wikimedia\Rdbms\DatabaseMysqli, Title, NULL)
#6 /srv/mediawiki/php-1.32.0-wmf.24/includes/MovePage.php(589): WikiPage->updateRevisionOn(Wikimedia\Rdbms\DatabaseMysqli, Revision, integer)
#7 /srv/mediawiki/php-1.32.0-wmf.24/includes/MovePage.php(271): MovePage->moveToInternal(User, Title, string, boolean, array)
#8 /srv/mediawiki/php-1.32.0-wmf.24/extensions/CentralAuth/includes/LocalRenameJob/LocalPageMoveJob.php(73): MovePage->move(User, string, boolean)
#9 /srv/mediawiki/php-1.32.0-wmf.24/extensions/CentralAuth/includes/LocalRenameJob/LocalPageMoveJob.php(55): LocalPageMoveJob->movePage(Title, Title)
#10 /srv/mediawiki/php-1.32.0-wmf.24/extensions/EventBus/includes/JobExecutor.php(65): LocalPageMoveJob->run()
aaron added a comment.Oct 4 2018, 11:27 PM

Are these jobs that try to also move user subpages?

Krinkle added a comment.EditedNov 25 2018, 1:27 AM

Are these jobs that try to also move user subpages?

Yes, from what I can tell, the only code that queues a LocalPageMoveJob is another job, namely LocalRenameUserJob. However, they are not nested as far as I can tell. Rather, LocalRenameUserJob pushes instances of LocalPageMoveJob into the queue.

From what I can tell, each LocalPageMoveJob only performs a single page rename. And LocalRenameUserJob itself doesn't perform any edits or page writes (only user and globaluser table interaction).