public $mDb;
public $preventClickjacking = false;
+ /** @var DatabaseBase */
+ public $mDbSecondary;
+
/**
* @var array
*/
$month = isset( $options['month'] ) ? $options['month'] : false;
$this->getDateCond( $year, $month );
+ // Most of this code will use the 'contributions' group DB, which can map to slaves
+ // with extra user based indexes or partioning by user. The additional metadata
+ // queries should use a regular slave since the lookup pattern is not all by user.
+ $this->mDbSecondary = wfGetDB( DB_SLAVE ); // any random slave
$this->mDb = wfGetDB( DB_SLAVE, 'contributions' );
}
$batch->add( $row->page_namespace, $row->page_title );
}
}
- $this->mParentLens = Revision::getParentLengths( $this->getDatabase(), $revIds );
+ $this->mParentLens = Revision::getParentLengths( $this->mDbSecondary, $revIds );
$batch->execute();
$this->mResult->seek( 0 );
}