* @ingroup Maintenance ExternalStorage
*/
+use Wikimedia\Rdbms\IMaintainableDatabase;
use MediaWiki\Logger\LegacyLogger;
use MediaWiki\MediaWikiServices;
use MediaWiki\Shell\Shell;
-use Wikimedia\Rdbms\IDatabase;
$optionsWithArgs = RecompressTracked::getOptionsWithArgs();
require __DIR__ . '/../commandLine.inc';
if ( $this->replicaId !== false ) {
$header .= "({$this->replicaId})";
}
- $header .= ' ' . wfWikiID();
+ $header .= ' ' . WikiMap::getCurrentWikiDbDomain()->getId();
LegacyLogger::emit( sprintf( "%-50s %s\n", $header, $msg ), $file );
}
* writing are all slow.
*/
function startReplicaProcs() {
+ $wiki = WikiMap::getWikiIdFromDbDomain( WikiMap::getCurrentWikiDbDomain() );
+
$cmd = 'php ' . Shell::escape( __FILE__ );
foreach ( self::$cmdLineOptionMap as $cmdOption => $classOption ) {
if ( $cmdOption == 'replica-id' ) {
}
}
$cmd .= ' --child' .
- ' --wiki ' . Shell::escape( wfWikiID() ) .
+ ' --wiki ' . Shell::escape( $wiki ) .
' ' . Shell::escape( ...$this->destClusters );
$this->replicaPipes = $this->replicaProcs = [];
/**
* Dispatch a command to the next available replica DB.
* This may block until a replica DB finishes its work and becomes available.
+ * @param array|string ...$args
*/
function dispatch( ...$args ) {
$pipes = $this->replicaPipes;
/**
* Gets a DB master connection for the given external cluster name
* @param string $cluster
- * @return IDatabase
+ * @return IMaintainableDatabase
*/
function getExtDB( $cluster ) {
$lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory();
$lb = $lbFactory->getExternalLB( $cluster );
- return $lb->getConnection( DB_MASTER );
+ return $lb->getMaintenanceConnectionRef( DB_MASTER );
}
/**
/** @var RecompressTracked */
public $parent;
public $blobClass;
- /** @var ConcatenatedGzipHistoryBlob */
+ /** @var ConcatenatedGzipHistoryBlob|false */
public $cgz;
public $referrers;
+ /** @var array */
+ private $texts;
/**
* Create a transaction from a RecompressTracked object