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

Reedy created this task.Jun 21 2018, 1:47 PM
Restricted Application added a subscriber: Aklapper. · View Herald TranscriptJun 21 2018, 1:47 PM
Reedy updated the task description. (Show Details)Jun 21 2018, 1:48 PM
Vvjjkkii renamed this task from Should addWiki call setDB to 1iaaaaaaaa.Jul 1 2018, 1:02 AM
Vvjjkkii triaged this task as High priority.
Vvjjkkii updated the task description. (Show Details)
Vvjjkkii removed a subscriber: Aklapper.
CommunityTechBot renamed this task from 1iaaaaaaaa to Should addWiki call setDB.Jul 2 2018, 8:09 AM
CommunityTechBot raised the priority of this task from High to Needs Triage.
CommunityTechBot updated the task description. (Show Details)
CommunityTechBot added a subscriber: Aklapper.

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 closed this task as Resolved.Aug 21 2018, 6:15 PM
Reedy claimed this task.
Reedy removed a project: Patch-For-Review.