From a8002c66236cc46bcd3a889324c4aa8779582f1d Mon Sep 17 00:00:00 2001 From: Aaron Schulz Date: Sat, 21 Jul 2012 11:39:18 -0700 Subject: [PATCH] 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 --- includes/EditPage.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 ) { -- 2.20.1