Steps to replicate the issue (include links if applicable):
- wiki farm through shared DB. At least: 1 base wiki containing the accounts (wiki_1), 1 wiki using the shared table (wiki_2)
- add actor in $wgSharedTables
// minimal change $wgSharedDB = 'wiki_1_shared_db'; $wgSharedTables = array_merge($wgSharedTables, ['actor']);
- execute dump on the wiki_2 php maintenace/dumpBackup.php --wiki wiki_2 --current
What happens?:
Dump only contains NS result
<mediawiki xmlns="http://www.mediawiki.org/xml/export-0.11/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.mediawiki.org/xml/export-0.11/ http://www.mediawiki.org/xml/export-0.11.xsd" version="0.11" xml:lang="en">
<siteinfo>
<sitename>XXXXXXXXXXXXXX</sitename>
<dbname>XXXXXXXXXXXXXX</dbname>
<base>XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX</base>
<generator>MediaWiki 1.39.4</generator>
<case>first-letter</case>
<namespaces>
<namespace key="-2" case="first-letter">Media</namespace>
...
<namespace key="2303" case="case-sensitive">Gadget definition talk</namespace>
</namespaces>
</siteinfo>
</mediawiki>What should have happened instead?:
Dump should be output full dump
Software version (skip for WMF-hosted wikis like Wikipedia):
REL1_39
Other information (browser name/version, screenshots, etc.):
- patch that fixed this issue:
diff --git a/maintenance/includes/BackupDumper.php b/maintenance/includes/BackupDumper.php index 74f8202868c..3f5b2de3920 100644 --- a/maintenance/includes/BackupDumper.php +++ b/maintenance/includes/BackupDumper.php @@ -405,8 +405,7 @@ abstract class BackupDumper extends Maintenance { return $this->forcedDb; } - $lbFactory = MediaWikiServices::getInstance()->getDBLoadBalancerFactory(); - $this->lb = $lbFactory->newMainLB(); + $this->lb = MediaWikiServices::getInstance()->getDBLoadBalancer(); $db = $this->lb->getMaintenanceConnectionRef( DB_REPLICA, 'dump' ); // Discourage the server from disconnecting us if it takes a long time
- This also affects DumpsOnDemand extension. Fix applied:
diff --git a/src/Jobs/DoDatabaseDumpJob.php b/src/Jobs/DoDatabaseDumpJob.php index cbf96f6..061a9ad 100644 --- a/src/Jobs/DoDatabaseDumpJob.php +++ b/src/Jobs/DoDatabaseDumpJob.php @@ -47,7 +47,10 @@ class DoDatabaseDumpJob extends Job implements GenericParameterJob { * @return bool */ public function run(): bool { - $dbr = $this->lbFactory->newMainLB()->getMaintenanceConnectionRef( DB_REPLICA, 'dump' ); + $dbr = MediaWikiServices::getInstance() + ->getDBLoadBalancer() + ->getMaintenanceConnectionRef( DB_REPLICA, 'dump' ); + $dbr->setSessionOptions( [ 'connTimeout' => 3600 ] ); if ( $this->params['fullHistory'] ) {
- Running newMainLB(); does not seem to apply table aliases when $wgSharedTables and $wgSharedDB are defined. This seems to be needed to be executed for new LBs
if ( $wgSharedDB && $wgSharedTables ) {
// Apply $wgSharedDB table aliases for the local LB (all non-foreign DB connections)
MediaWikiServices::getInstance()->getDBLoadBalancer()->setTableAliases(
array_fill_keys(
$wgSharedTables,
[
'dbname' => $wgSharedDB,
'schema' => $wgSharedSchema,
'prefix' => $wgSharedPrefix
]
)
);
}