Moving pages is completely broken in 1.21wmf12
Closed, ResolvedPublic

Description

Trying to move any page to a title that didn't previously exist causes an exception in 1.21wmf12.

I captured the following backtrace from nlwikimedia, using a debugging hack that includes $title->getPrefixedText() (which turned out to be the title the page was being moved to) in the exception message. I could also reproduce this my trying to move [[Test]] to [[Test2]] on test2.wikipedia.org .

2013-03-21 01:51:52 mw1055 nlwikimedia: [458e1031] /w/index.php?title=Speciaal:PaginaHernoemen&action=submit Exception from line 71 of /usr/local/apache/common-local/php-1.21wmf12/includes/LinksUpdate.php: The Title object for Wikimedia:De kroeg/Archief/2007 did not provide an article ID. Perhaps the page doesn't exist?
#0 /usr/local/apache/common-local/php-1.21wmf12/includes/parser/ParserOutput.php(474): LinksUpdate->__construct(Object(Title), Object(ParserOutput), true)
#1 /usr/local/apache/common-local/php-1.21wmf12/includes/content/AbstractContent.php(242): ParserOutput->getSecondaryDataUpdates(Object(Title), true)
#2 /usr/local/apache/common-local/php-1.21wmf12/includes/WikiPage.php(2066): AbstractContent->getSecondaryDataUpdates(Object(Title), NULL, true, Object(ParserOutput))
#3 /usr/local/apache/common-local/php-1.21wmf12/includes/Title.php(3847): WikiPage->doEditUpdates(Object(Revision), Object(User), Array)
#4 /usr/local/apache/common-local/php-1.21wmf12/includes/Title.php(3683): Title->moveToInternal(Object(Title), '', false)
#5 /usr/local/apache/common-local/php-1.21wmf12/includes/specials/SpecialMovepage.php(462): Title->moveTo(Object(Title), true, '', false)
#6 /usr/local/apache/common-local/php-1.21wmf12/includes/specials/SpecialMovepage.php(97): MovePageForm->doSubmit()
#7 /usr/local/apache/common-local/php-1.21wmf12/includes/SpecialPage.php(613): MovePageForm->execute(NULL)
#8 /usr/local/apache/common-local/php-1.21wmf12/includes/SpecialPageFactory.php(487): SpecialPage->run(NULL)
#9 /usr/local/apache/common-local/php-1.21wmf12/includes/Wiki.php(291): SpecialPageFactory::executePath(Object(Title), Object(RequestContext))
#10 /usr/local/apache/common-local/php-1.21wmf12/includes/Wiki.php(565): MediaWiki->performRequest()
#11 /usr/local/apache/common-local/php-1.21wmf12/includes/Wiki.php(458): MediaWiki->main()
#12 /usr/local/apache/common-local/php-1.21wmf12/index.php(59): MediaWiki->run()
#13 /usr/local/apache/common-local/live-1.5/index.php(3): require('/usr/local/apac...')
#14 {main}


Version: unspecified
Severity: critical

bzimport set Reference to bz46397.
Catrope created this task.Via LegacyMar 21 2013, 2:00 AM
greg added a comment.Via ConduitMar 21 2013, 4:29 AM

If this isn't able to be fixed by tomorrow afternoon, let's roll back the wmf12 deploy.

Tim: Since you're awake first, can you debug and update us here, please?

greg added a comment.Via ConduitMar 21 2013, 4:31 AM

Chris: Is this functionality covered in our test suite? If not, let's put it in the backlog.

MZMcBride added a comment.Via ConduitMar 21 2013, 6:25 AM

On test2.wikipedia.org, moved "Title A" to "Title B". "Title A" now has an incorrect page_latest, an incorrect page_len, and an incorrect page_is_redirect:


mysql> select * from page where page_title = 'Title_A' and page_namespace = 0\G

  • 1. row ******* page_id: 6762 page_namespace: 0 page_title: Title_A

page_restrictions:

page_counter: 0

page_is_redirect: 0

 page_is_new: 1
 page_random: 0.523019457806
page_touched: 20130321061504
 page_latest: 0
    page_len: 0

1 row in set (0.00 sec)

RobLa-WMF added a comment.Via ConduitMar 21 2013, 6:31 AM
  • Bug 46403 has been marked as a duplicate of this bug. ***
tstarling added a comment.Via ConduitMar 21 2013, 6:40 AM

This is most likely due to Iea16d672 (thanks Robla for pointing me in this direction).

Title::moveToInternal() moves the page and then calls $nt->resetArticleID($oldid) to reset the article ID. Then a new WikiPage is constructed with the title $nt, and updates are called on this WikiPage object. Before Iea16d672, $newpage->getId() would have returned the new ID due to it being stored in $nt->mArticleId, but after Iea16d672, $newpage->getId() calls $newpage->loadPageData(), which fetches the page_id from the *slave* database. Of course, it is not in the slave yet, since the update query and the select query are separated by microseconds.

It is easy to reproduce locally with $wgAllDBsAreLocalhost = true, with zero master load.

tstarling added a comment.Via ConduitMar 21 2013, 6:43 AM

(In reply to comment #5)

It is easy to reproduce locally with $wgAllDBsAreLocalhost = true, with zero
master load.

That is to say, the update transaction is still open, so even a separate master connection does not see the new page_id. It's not necessary to actually have replication to see the issue.

I have rolled back all wikis to MW 1.21wmf11 and thus will lower the priority.

liangent added a comment.Via ConduitMar 21 2013, 9:37 AM
  • Bug 46411 has been marked as a duplicate of this bug. ***
MZMcBride added a comment.Via ConduitMar 21 2013, 11:10 PM

Roan wrote https://gerrit.wikimedia.org/r/55086, which was self-merged and then deployed by Chris S. to test2.wikipedia.org (cf. https://wikitech.wikimedia.org/w/index.php?title=Server_Admin_Log&diff=64335&oldid=64333&diffonly=1).

aaron added a comment.Via ConduitMar 21 2013, 11:35 PM
aaron added a comment.Via ConduitMar 22 2013, 5:29 PM

(In reply to comment #10)

One more change needed: https://gerrit.wikimedia.org/r/#/c/55218/

Merged.

(In reply to comment #11)

see also https://bugzilla.wikimedia.org/46427

That bug is still present.

aaron added a comment.Via ConduitMar 22 2013, 5:52 PM

I don't get this error, but some people are still getting "LinkCache doesn't know about this title".

aaron added a comment.Via ConduitMar 22 2013, 9:14 PM

Add Comment