Page MenuHomePhabricator

Should addWiki call setDB
Closed, ResolvedPublic


Following up on T197863, we run addWiki with --wiki=aawiki (hack we know)

But when we run child scripts, we don't do anything for changing the db... So they're going to be running against aawiki?

		// Sets up the filebackend zones
		$setZones = $this->runChild(

		$setZones->mOptions['backend'] = 'local-multiwrite';
		if ( $this->isPrivate( $dbName ) ) {
			$setZones->mOptions['private'] = 1;

If we look at runChild

	public function runChild( $maintClass, $classFile = null ) {
		// Make sure the class is loaded first
		if ( !class_exists( $maintClass ) ) {
			if ( $classFile ) {
				require_once $classFile;
			if ( !class_exists( $maintClass ) ) {
				$this->error( "Cannot spawn child: $maintClass" );

		 * @var $child Maintenance
		$child = new $maintClass();
		$child->loadParamsAndArgs( $this->mSelf, $this->mOptions, $this->mArgs );
		if ( !is_null( $this->mDb ) ) {
			$child->setDB( $this->mDb );

		return $child;

It checks if mDb has been set to something, and alters the child to match..

The Cirrus Scripts handle this differently (fine)...

$searchIndex->mOptions[ 'baseName' ] = $dbName;

But the other scripts... Do not? Potentially affecting Wikidata and Cognate too

Event Timeline

Change 450221 had a related patch set uploaded (by Reedy; owner: Reedy):
[mediawiki/extensions/WikimediaMaintenance@master] Call ->setDB() in various places

Change 450221 merged by jenkins-bot:
[mediawiki/extensions/WikimediaMaintenance@master] Call ->setDB() in various places

Reedy claimed this task.
Reedy removed a project: Patch-For-Review.