r56711 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r56710‎ | r56711 | r56712 >
Date:16:15, 21 September 2009
Author:werdna
Status:ok
Tags:
Comment:
Use unbuffered queries in cleanupTable maintenance scripts. Prevents OOM issues.
Modified paths:
  • /trunk/phase3/maintenance/cleanupTable.inc (modified) (history)

Diff [purge]

Index: trunk/phase3/maintenance/cleanupTable.inc
@@ -87,6 +87,10 @@
8888
8989 protected function runTable( $table, $where, $callback ) {
9090 $dbw = wfGetDB( DB_MASTER );
 91+
 92+ // Unbuffered queries, avoids OOM
 93+ $dbw->bufferResults( false );
 94+
9195 $count = $dbw->selectField( $table, 'count(*)', '', __METHOD__ );
9296 $this->init( $count, $table );
9397 $this->output( "Processing $table..." );
@@ -98,8 +102,12 @@
99103 foreach( $result as $row ) {
100104 call_user_func( $callback, $row );
101105 }
 106+
102107 $this->output( "Finished $table... $this->updated of $this->processed rows updated\n" );
 108+
103109 $result->free();
 110+
 111+ $dbw->bufferResults( true );
104112 }
105113
106114 protected function hexChar( $matches ) {

Follow-up revisions

RevisionCommit summaryAuthorDate
r56712Merge r56711, maintenance fixwerdna16:16, 21 September 2009
r56862Fixes for TitleCleanup subclasses:...tstarling04:19, 24 September 2009

Status & tagging log