Databases on m5:
labsdbaccounts mailman3 mailman3web striker test_labsdbaccounts toolhub
Impact: Writes will be disabled for around 15-30 seconds.
Failover process
OLD MASTER: db1164
NEW MASTER: db1228
- Check configuration differences between new and old master
pt-config-diff h=db1164.eqiad.wmnet,F=/root/.my.cnf h=db1228.eqiad.wmnet,F=/root/.my.cnf
- Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --minutes 60 -r "m5 master switch T432967" 'A:db-section-m5'
- Topology changes: move everything under db1228
sudo db-switchover --timeout=15 --only-slave-move db1164.eqiad.wmnet db1228.eqiad.wmnet
- Disable puppet db1164 and db1228 sudo cumin 'db1164* or db1228*' 'disable-puppet "primary switchover T432967"'
- Merge gerrit: https://gerrit.wikimedia.org/r/1318563
- Run puppet on dbproxy1027 and dbproxy1029 and check the config
run-puppet-agent && cat /etc/haproxy/conf.d/db-master.cfg
- Start the failover: !log Failover m5 from db1164 to db1228 - T432967
- DB switchover
root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# db-switchover --skip-slave-move db1164 db1228
- Reload haproxies (dbproxy1029 is the active one)
dbproxy1027: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio dbproxy1029: 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):db1164 and db1228 sudo cumin 'db1164* or db1228*' 'run-puppet-agent -e "primary switchover T432967"'
- Check affected services
- Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag:
- sudo db-mysql db1228 heartbeat -e "delete from heartbeat where file like 'db1164%';"