r51269 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51268‎ | r51269 | r51270 >
Date:04:30, 1 June 2009
Author:aaron
Status:ok
Tags:
Comment:
*Reverted r49852 and removed locking reads (bug 17275)
*Fixed r50998, dangling references to removed functions were still there
Modified paths:
  • /trunk/extensions/FlaggedRevs/FlaggedRevision.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/FlaggedRevs.class.php (modified) (history)
  • /trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc (modified) (history)
  • /trunk/extensions/FlaggedRevs/specialpages/RevisionReview_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/FlaggedRevs/maintenance/reviewAllPages.inc
@@ -33,7 +33,7 @@
3434 $title = Title::makeTitle( $row->page_namespace, $row->page_title );
3535 $rev = Revision::newFromId( $row->page_latest );
3636 # Is it already reviewed?
37 - $frev = FlaggedRevision::newFromTitle( $title, $row->page_latest, FR_FOR_UPDATE );
 37+ $frev = FlaggedRevision::newFromTitle( $title, $row->page_latest, FR_MASTER );
3838 # Should exist, but to be safe...
3939 if( !$frev && $rev && FlaggedRevs::isPageReviewable($title) ) {
4040 $text = $rev->getText();
Index: trunk/extensions/FlaggedRevs/FlaggedRevs.class.php
@@ -333,7 +333,7 @@
334334 $qal = min($wgFlaggedRevsAutoReview-1,$quality);
335335 # Pristine auto-review?
336336 if( $qal == FR_PRISTINE ) {
337 - $flags = self::quickPristineTags();
 337+ $flags = self::quickTags( FR_PRISTINE );
338338 # If tags are available and user can set them, we are done...
339339 if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) {
340340 return $flags;
@@ -342,7 +342,7 @@
343343 }
344344 # Quality auto-review?
345345 if( $qal == FR_QUALITY ) {
346 - $flags = self::quickQualityTags();
 346+ $flags = self::quickTags( FR_QUALITY );
347347 # If tags are available and user can set them, we are done...
348348 if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) {
349349 return $flags;
@@ -351,7 +351,7 @@
352352 }
353353 # Sighted auto-review?
354354 if( $qal == FR_SIGHTED ) {
355 - $flags = self::quickSightedTags();
 355+ $flags = self::quickTags( FR_SIGHTED );
356356 # If tags are available and user can set them, we are done...
357357 if( RevisionReview::userCanSetFlags( $flags, array(), $config ) ) {
358358 return $flags;
@@ -1413,7 +1413,7 @@
14141414
14151415 # If we know that this is now the new stable version
14161416 # (which it probably is), save it to the cache...
1417 - $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_FOR_UPDATE/*consistent*/ );
 1417+ $sv = FlaggedRevision::newFromStable( $article->getTitle(), FR_MASTER/*consistent*/ );
14181418 if( $sv && $sv->getRevId() == $rev->getId() ) {
14191419 # Update stable cache
14201420 self::updatePageCache( $article, $poutput );
Index: trunk/extensions/FlaggedRevs/FlaggedRevision.php
@@ -69,7 +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 ) $options[] = 'LOCK IN SHARE MODE';
 73+ if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
7474 } else {
7575 $db = wfGetDB( DB_SLAVE );
7676 }
@@ -140,7 +140,7 @@
141141 }
142142 $dbw = wfGetDB( DB_MASTER );
143143 $options['ORDER BY'] = 'fr_rev_id DESC';
144 - if( $flags & FR_FOR_UPDATE ) $options[] = 'LOCK IN SHARE MODE';
 144+ if( $flags & FR_FOR_UPDATE ) $options[] = 'FOR UPDATE';
145145 # Look for the latest pristine revision...
146146 if( FlaggedRevs::pristineVersions() && $config['select'] != FLAGGED_VIS_LATEST ) {
147147 $prow = $dbw->selectRow( array('flaggedrevs','revision'),
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/*consistent*/ );
 647+ $sv = FlaggedRevision::newFromStable( $this->page, FR_MASTER/*consistent*/ );
648648 if( $sv && $sv->getRevId() == $rev->getId() ) {
649649 global $wgParserCacheExpireTime;
650650 $this->page->invalidateCache();

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r49851Tweak for bug 17275: no need to lock other session reads just for consistent ...aaron01:32, 25 April 2009
r49852Limit locking in newFromTitle() tooaaron02:06, 25 April 2009
r49889Tweak for bug 17275: reduce autoreview transaction time by moving hook after ...aaron01:00, 26 April 2009
r50998Merged some tag functions for simplicityaaron00:46, 26 May 2009

Status & tagging log