db1213 needs to be rebooted and upgraded
Databases on m3: `phabricator`
When: TBD
**Impact: Writes will be disabled for around 1 minute.**
Failover process
OLD MASTER: db1213
NEW MASTER: db1250
[] Check configuration differences between new and old master
`$ pt-config-diff h=db1213.eqiad.wmnet,F=/root/.my.cnf h=db1250.eqiad.wmnet,F=/root/.my.cnf `
[] Silence alerts on all hosts: `sudo cookbook sre.hosts.downtime --hours 1 -r "m3 master switchover T398818" 'A:db-section-m3'`
[] Topology changes: move everything under db1250
`db-switchover --timeout=15 --only-slave-move db1213.eqiad.wmnet db1250.eqiad.wmnet`
[] Disable puppet db1250 and db1213
`sudo cumin 'db1213* or db1250*' 'disable-puppet "primary switchover T398818"'`
[] Merge gerrit:
[] Run puppet on dbproxy1026 and dbproxy1028 and check the config
`run-puppet-agent && cat /etc/haproxy/conf.d/db-master.cfg`
[] Start the failover: `!log Failover m3 from db1213 to db1250 - T398818`
[] 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 --skip-slave-move db1213 db1250 `
[] Reload haproxies
```
dbproxy1026: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
dbproxy1028: systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
```
[] kill connections on the old master (db1213)
` 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): db1250 and db1213
`sudo cumin 'db1250* or db1213*' 'run-puppet-agent -e "primary switchover T398818"'`
[] Check services affected: phabricator
[] Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag: `delete from heartbeat where server_id=171966512;`