Reverted "FOR UPDATE" in 61f246aa786d824d0653522ed679c16be719da80.
authorAaron Schulz <aschulz@wikimedia.org>
Sat, 21 Jul 2012 18:39:18 +0000 (11:39 -0700)
committerAaron Schulz <aschulz@wikimedia.org>
Sat, 21 Jul 2012 18:39:30 +0000 (11:39 -0700)
* Previously, this code would select FOR UPDATE unless ALF_NO_LINK_LOCK
was set in $wgAntiLockFlags (which in fact was set for wmf sites for ages
to reduce contention). In this case, it was just loading from the master,
without locking, and relying on the page_latest check. Now, it just never
selects FOR UPDATE, regardless of the lock flags, relying on page_latest.

Change-Id: Ie6301de4415f56e6be3899cf4ab37924963ce8c4

includes/EditPage.php

index 03f5ba7..f8be535 100644 (file)
@@ -1201,9 +1201,9 @@ class EditPage {
 
                wfProfileOut( __METHOD__ . '-checks' );
 
-               // Use SELECT FOR UPDATE here to avoid transaction collision in
-               // WikiPage::updateRevisionOn() and ending in the self::AS_END case.
-               $this->mArticle->loadPageData( 'forupdate' );
+               # Load the page data from the master. If anything changes in the meantime,
+               # we detect it by using page_latest like a token in a 1 try compare-and-swap.
+               $this->mArticle->loadPageData( 'fromdbmaster' );
                $new = !$this->mArticle->exists();
 
                if ( $new ) {