From: Aaron Schulz Date: Sat, 21 Jul 2012 18:39:18 +0000 (-0700) Subject: Reverted "FOR UPDATE" in 61f246aa786d824d0653522ed679c16be719da80. X-Git-Tag: 1.31.0-rc.0~22985^2 X-Git-Url: http://git.cyclocoop.org/%22.%28%24lien.?a=commitdiff_plain;h=a8002c66236cc46bcd3a889324c4aa8779582f1d;p=lhc%2Fweb%2Fwiklou.git Reverted "FOR UPDATE" in 61f246aa786d824d0653522ed679c16be719da80. * 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 --- diff --git a/includes/EditPage.php b/includes/EditPage.php index 03f5ba7839..f8be535e60 100644 --- a/includes/EditPage.php +++ b/includes/EditPage.php @@ -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 ) {