Problem
Without knowing (and without intending to), I created several DB tables on the main database cluster (testwikidatawiki) and a whole new database on the s3 cluster for wikidatawiki (which should not exist there at all). The createExtensionTables.php maintenance script did not warn me that was going to happen.
Root Cause
Shortly before enabling GrowthExperiments on Wikidata (T418115), I executed createExtensionTables.php to prepare the extension tables:
[urbanecm@deploy1003 ~]$ mwscript-k8s --comment=T418115 --dblist=wikidata --sal -f WikimediaMaintenance:createExtensionTables.php -- GrowthExperiments ⏳ Starting WikimediaMaintenance:createExtensionTables.php on Kubernetes as job mw-script.eqiad.0or1tu73 ... 🚀 Job is running. 📜 Streaming logs: WikimediaMaintenance:createExtensionTables.php: Running on wikidata ----------------------------------------------------------------- testwikidatawiki ----------------------------------------------------------------- testwikidatawiki Creating GrowthExperiments tables... testwikidatawiki sourcing growthexperiments_link_recommendations.sql testwikidatawiki sourcing growthexperiments_link_submissions.sql testwikidatawiki sourcing growthexperiments_mentee_data.sql testwikidatawiki sourcing growthexperiments_mentor_mentee.sql testwikidatawiki sourcing growthexperiments_user_impact.sql testwikidatawiki done! ----------------------------------------------------------------- wikidatawiki ----------------------------------------------------------------- wikidatawiki Creating GrowthExperiments tables... wikidatawiki sourcing growthexperiments_link_recommendations.sql wikidatawiki sourcing growthexperiments_link_submissions.sql wikidatawiki sourcing growthexperiments_mentee_data.sql wikidatawiki sourcing growthexperiments_mentor_mentee.sql wikidatawiki sourcing growthexperiments_user_impact.sql wikidatawiki done! [urbanecm@deploy1003 ~]$
GrowthExperiments stores its DB tables on the x1 per-wiki cluster. However, those DB tables were not actually created there:
wikiadmin2023@10.64.16.6(testwikidatawiki)> show tables; +---------------------------------------+ | Tables_in_testwikidatawiki | +---------------------------------------+ | echo_email_batch | | echo_event | | echo_notification | | echo_target_page | | mediamoderation_scan | | translate_cache | | translate_message_group_subscriptions | +---------------------------------------+ 7 rows in set (0.001 sec)
When I investigated, I found that those tables are on the main DB section instead:
wikiadmin2023@10.64.32.196(testwikidatawiki)> show tables like 'growth%'; +----------------------------------------+ | Tables_in_testwikidatawiki (growth%) | +----------------------------------------+ | growthexperiments_link_recommendations | | growthexperiments_link_submissions | | growthexperiments_mentee_data | | growthexperiments_mentor_mentee | | growthexperiments_user_impact | +----------------------------------------+ 5 rows in set (0.000 sec)
This happens because the maintenance script creates the tables in the following way:
$geLB = MediaWikiServices::getInstance()->getDBLoadBalancerFactory() ->getLoadBalancer( 'virtual-growthexperiments' ); [...] $dbw = $geLB->getConnection( DB_PRIMARY ); $dbw->sourceFile( ... );
The virtual-growthexperiments virtual domain is defined in CommonSettings.php:
if ( $wmgUseGrowthExperiments ) { wfLoadExtension( 'GrowthExperiments' ); $wgVirtualDomainsMapping['virtual-growthexperiments'] = [ 'cluster' => 'extension1', 'db' => false ]; }
and as a result, it is configured only when $wmgUseGrowthExperiments is true. However, when $wmgUseGrowthExperiments is true, I already need the DB tables to be created, to avoid "table not existing" error.