wgShareTables allows MediaWiki to share user and actor table. In Setup.php the LOCAL wiki DB load balancer is setup for the shared DB via setTableAliases, but ActorStore is supposed to be cross-wiki-aware, so it needs to figure out whether to use connect to the shared database for actor table or not.
We need to figure out why was the Setup.php setup limited to local wiki domain. My guess is that wikis on the same farm can be configured differently with regards to using the shared database, and in setup.php we do not know if the target foreign wiki uses the same shared DB. I wonder if such setup is possible and something we would want to support? If not, can we configure sharedDB for all the wikis via calling setTableAliases on the LBFactory instead of main load balancer?