r84459 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r84458‎ | r84459 | r84460 >
Date:16:46, 21 March 2011
Author:platonides
Status:ok
Tags:
Comment:
(Bug 26223) Concurrently moving an article to different titles leaks a redirect revision with no page.
Just the GAID_FOR_UPDATE fixes the issue in my tests, but without the transaction there's still potential for inconsistencies.
Modified paths:
  • /trunk/phase3/includes/Title.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/Title.php
@@ -3091,13 +3091,16 @@
30923092 }
30933093 }
30943094
3095 - $pageid = $this->getArticleID();
 3095+ $dbw->begin(); # If $file was a LocalFile, its transaction would have closed our own.
 3096+ $pageid = $this->getArticleID( GAID_FOR_UPDATE );
30963097 $protected = $this->isProtected();
30973098 $pageCountChange = ( $createRedirect ? 1 : 0 ) - ( $nt->exists() ? 1 : 0 );
30983099
30993100 // Do the actual move
31003101 $err = $this->moveToInternal( $nt, $reason, $createRedirect );
31013102 if ( is_array( $err ) ) {
 3103+ # FIXME: What about the File we have already moved?
 3104+ $dbw->rollback();
31023105 return $err;
31033106 }
31043107
@@ -3166,6 +3169,8 @@
31673170 $u = new SearchUpdate( $redirid, $this->getPrefixedDBkey(), '' );
31683171 $u->doUpdate();
31693172
 3173+ $dbw->commit();
 3174+
31703175 # Update site_stats
31713176 if ( $this->isContentPage() && !$nt->isContentPage() ) {
31723177 # No longer a content page
@@ -3320,7 +3325,7 @@
33213326 $redirectSuppressed = false;
33223327 } else {
33233328 // Get rid of old new page entries in Special:NewPages and RC.
3324 - // Needs to be before $this->resetArticleUD( 0 ).
 3329+ // Needs to be before $this->resetArticleID( 0 ).
33253330 $dbw->delete( 'recentchanges', array(
33263331 'rc_timestamp' => $dbw->timestamp( $this->getEarliestRevTime() ),
33273332 'rc_namespace' => $oldns,

Follow-up revisions

RevisionCommit summaryAuthorDate
r84496MFT r84459 + RELEASE NOTESplatonides22:07, 21 March 2011
r852561.17wmf1: MFT r80813, r80815, r83798, r84459, r84729, r84820, r84921, r84985,...catrope14:13, 3 April 2011

Status & tagging log