Page MenuHomePhabricator

Update CopyPatrol to use new replicas design
Closed, ResolvedPublic2 Estimated Story Points

Description

This tool only connects to a single replica database, so we can use the simple solution of dynamically changing the hostname at connection time.

Background info: https://wikitech.wikimedia.org/wiki/News/Wiki_Replicas_2020_Redesign

Acceptance criteria

  • The tool should use the hostname for the desired database to be compatible with the new replicas design

Event Timeline

Restricted Application added a subscriber: Aklapper. ยท View Herald TranscriptJan 5 2021, 4:19 AM
MusikAnimal set the point value for this task to 2.

PR: https://github.com/wikimedia/CopyPatrol/pull/100

Here I did a cheap (but effective) solution of replacing a wildcard * with the correct database name when the connection is made. So, all we have to do is change the .env file on production to have DB_REPLICA_HOST = *.web.db.svc.eqiad.wmflabs. If the tool is being ran locally, you simply won't use a wildcard and instead hard-code your .env to connect to the desired database.

This is running on staging now: https://plagiabot.toolforge.org/ . The hostname is set to use the wildcard, so we know it's working because otherwise it'd error out given *.web.db.svc.eqiad.wmflabs is not valid.

Assuming the above solution is acceptable, I'll retroactively estimate this at just 2 points.

Merged and deployed. I don't think this needs QA because we only changed the database hostname, which if incorrect would cause the tool to show an error page.