r49851 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r49850‎ | r49851 | r49852 >
Date:01:32, 25 April 2009
Author:aaron
Status:ok
Tags:
Comment:
Tweak for bug 17275: no need to lock other session reads just for consistent reads here
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -1423,7 +1423,7 @@
14241424
14251425 # If we know that this is now the new stable version
14261426 # (which it probably is), save it to the cache...
1427 - $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE );
 1427+ $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE/*consistent*/ );
14281428 if( $sv && $sv->getRevId() == $rev->getId() ) {
14291429 # Update stable cache
14301430 self::updatePageCache( $article, $poutput );
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -69,8 +69,7 @@
7070 # User master/slave as appropriate
7171 if( $flags & FR_FOR_UPDATE || $flags & FR_MASTER ) {
7272 $db = wfGetDB( DB_MASTER );
73 - if( $flags & FR_FOR_UPDATE )
74 - $options[] = 'FOR UPDATE';
 73+ if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
7574 } else {
7675 $db = wfGetDB( DB_SLAVE );
7776 }
@@ -86,7 +85,8 @@
8786 'fr_rev_id' => $revId,
8887 'rev_id = fr_rev_id',
8988 'rev_page = fr_page_id',
90 - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
 89+ 'rev_deleted & '.Revision::DELETED_TEXT => 0
 90+ ),
9191 __METHOD__,
9292 $options
9393 );
@@ -125,7 +125,8 @@
126126 $columns,
127127 array( 'fp_page_id' => $pageId,
128128 'fr_page_id = fp_page_id',
129 - 'fr_rev_id = fp_stable' ),
 129+ 'fr_rev_id = fp_stable'
 130+ ),
130131 __METHOD__
131132 );
132133 if( !$row ) return null;
@@ -139,7 +140,7 @@
140141 }
141142 $dbw = wfGetDB( DB_MASTER );
142143 $options['ORDER BY'] = 'fr_rev_id DESC';
143 - if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
 144+ if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE';
144145 # Look for the latest pristine revision...
145146 if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) {
146147 $prow = $dbw->selectRow( array('flaggedrevs','revision'),
@@ -148,7 +149,8 @@
149150 'fr_quality = 2',
150151 'rev_id = fr_rev_id',
151152 'rev_page = fr_page_id',
152 - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
 153+ 'rev_deleted & '.Revision::DELETED_TEXT => 0
 154+ ),
153155 __METHOD__,
154156 $options
155157 );
@@ -168,7 +170,8 @@
169171 $newerClause,
170172 'rev_id = fr_rev_id',
171173 'rev_page = fr_page_id',
172 - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
 174+ 'rev_deleted & '.Revision::DELETED_TEXT => 0
 175+ ),
173176 __METHOD__,
174177 $options
175178 );
@@ -181,7 +184,8 @@
182185 array( 'fr_page_id' => $pageId,
183186 'rev_id = fr_rev_id',
184187 'rev_page = fr_page_id',
185 - 'rev_deleted & '.Revision::DELETED_TEXT => 0 ),
 188+ 'rev_deleted & '.Revision::DELETED_TEXT => 0
 189+ ),
186190 __METHOD__,
187191 $options
188192 );
Index: trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php
@@ -643,7 +643,7 @@
644644 $u = new LinksUpdate( $this->page, $poutput );
645645 # If we know that this is now the new stable version
646646 # (which it probably is), save it to the stable cache...
647 - $sv = FlaggedRevision::newFromStable( $this->page, FR_FOR_UPDATE );
 647+ $sv = FlaggedRevision::newFromStable( $this->page, FR_FOR_UPDATE/*consistent*/ );
648648 if( $sv && $sv->getRevId() == $rev->getId() ) {
649649 global $wgParserCacheExpireTime;
650650 $this->page->invalidateCache();

Follow-up revisions

RevisionCommit summaryAuthorDate
r49889Tweak for bug 17275: reduce autoreview transaction time by moving hook after ...aaron01:00, 26 April 2009
r51269*Reverted r49852 and removed locking reads (bug 17275)...aaron04:30, 1 June 2009

Status & tagging log