Databases on m3: phabricator
When: Thursday 9th Feb 07:00 AM UTC
Impact: Writes will be disabled for around 1 minute.
Failover process
OLD MASTER: db1159
NEW MASTER: db1164
- Check configuration differences between new and old master
$ pt-config-diff h=db1164.eqiad.wmnet,F=/root/.my.cnf h=db1159.eqiad.wmnet,F=/root/.my.cnf
- Silence alerts on all hosts
- Topology changes: move everything under db1159
db-switchover --timeout=15 --only-slave-move db1164.eqiad.wmnet db1159.eqiad.wmnet
- Disable puppet db1159 and db1164 sudo cumin 'db1164* or db1159*' 'disable-puppet "primary switchover T329141"'
- Merge gerrit: https://gerrit.wikimedia.org/r/c/operations/puppet/+/887727/
- Run puppet on dbproxy1016 and dbproxy1020 and check the config
puppet agent -tv && cat /etc/haproxy/conf.d/db-master.cfg
- Start the failover: !log Failover m3 from db1164 to db1159 - T329141
- Set phabricator in RO:
ssh phab1004 sudo /srv/phab/phabricator/bin/config set cluster.read-only true # restart database server sudo /srv/phab/phabricator/bin/config set cluster.read-only false
- DB switchover
root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# db-switchover --read-only-master --skip-slave-move db1164 db1159
- Reload haproxies
dbproxy1016: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio dbproxy1020: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
- kill connections on the old master (db1164)
pt-kill --print --kill --victims all --match-all F=/dev/null,S=/run/mysqld/mysqld.sock
- Restart puppet on old and new masters (for heartbeat):db1159 and db1164 sudo cumin 'db1159* or db1164*' 'run-puppet-agent -e "primary switchover T329141"'
- Check services affected: phabricator
- Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag: delete from heartbeat where server_id=171970746
- Close this ticket and create a ticket to move db1164 to m1: T329143