Page MenuHomePhabricator

Does an eqiad Mediawiki need to have codfw DB servers in its hostsByName? and vice versa
Closed, ResolvedPublic

Description

Apologies, abusing the subscriber list and set of tags from T239900 to get some input on a question.

$wgLBFactoryConf['hostsByName'] presently contains hosts from both datacenters, duplicated across both db-eqiad.php and db-codfw.php.

There's also a hostsByName hash in etcd, ready for use, but it contains only the local-datacenter DB servers. See for instance https://noc.wikimedia.org/dbconfig/eqiad.json

Is there ever any reason that a Mediawiki in eqiad would need to contact a DB server in codfw, or vice versa? As far as I can tell this should be impossible, since none of those hostnames are referenced elsewhere in $wgLBFactoryConf, which means that Mediawiki should have no idea which servers correspond to which sections, or have any reason to otherwise reference those extra entries appearing in hostsByName.

But I wanted to make sure before enabling the use of hostsByName from etcd in production, and removing some hundreds of lines of PHP that are suffixed with # do not remove or comment out

Event Timeline

CDanis updated the task description. (Show Details)

Probably someone with more knowledge of MW will need to answer this but I want to bring up the topic of multi active DC, specially regarding this sentence

Is there ever any reason that a Mediawiki in eqiad would need to contact a DB server in codfw, or vice versa? As far as I can tell this should be impossible, since none of those hostnames are referenced elsewhere in $wgLBFactoryConf, which means that Mediawiki should have no idea which servers correspond to which sections, or have any reason to otherwise reference those extra entries appearing in hostsByName.

As of today, we indeed never do cross connections but maybe that list will be needed once we've got multi-dc?

multi-dc

Performance or CPT had some ideas about it, I think.

BTW I'm curious about both 1) the current need (or lack thereof) for cross-DC Mediawiki DB traffic, and also about 2) the future need. As it would be fairly trivial to make dbctl output this if/when we do need it -- but enabling hostsByName from etcd now is even easier.

As I mentioned T134809 is probably the most relevant ticket (although not the only one).

I don't see any code using entries in hostsByName that aren't listed in one of sectionLoads, groupLoadsBySection, groupLoadsByDB, or externalLoads.

Change 559136 had a related patch set uploaded (by CDanis; owner: CDanis):
[operations/mediawiki-config@master] dbctl: use hostsByName from etcd

https://gerrit.wikimedia.org/r/559136

Change 559136 merged by CDanis:
[operations/mediawiki-config@master] dbctl: use hostsByName from etcd

https://gerrit.wikimedia.org/r/559136

Mentioned in SAL (#wikimedia-operations) [2019-12-18T17:58:58Z] <cdanis@deploy1001> Synchronized wmf-config/CommonSettings.php: use hostsByName from etcd 96df9c004 T229676 T240991 (duration: 01m 01s)

Mentioned in SAL (#wikimedia-operations) [2019-12-18T18:00:35Z] <cdanis@deploy1001> Synchronized wmf-config/etcd.php: use hostsByName from etcd 96df9c004 T229676 T240991 (duration: 01m 01s)

Change 559154 had a related patch set uploaded (by CDanis; owner: CDanis):
[operations/mediawiki-config@master] remove dbctl-obsoleted hostsByName entries 🔧

https://gerrit.wikimedia.org/r/559154

Change 559154 merged by jenkins-bot:
[operations/mediawiki-config@master] remove dbctl-obsoleted hostsByName entries 🔧

https://gerrit.wikimedia.org/r/559154

Mentioned in SAL (#wikimedia-operations) [2019-12-18T18:13:58Z] <cdanis@deploy1001> Synchronized wmf-config/db-codfw.php: remove dbctl-obsoleted hostsByName entries 🔧 7d20965f5 T240991 T229676 (duration: 01m 01s)

Mentioned in SAL (#wikimedia-operations) [2019-12-18T18:15:53Z] <cdanis@deploy1001> Synchronized wmf-config/db-eqiad.php: remove dbctl-obsoleted hostsByName entries 🔧 7d20965f5 T240991 T229676 (duration: 01m 01s)

CDanis claimed this task.