As part of upgrading s5 to debian buster/mariadb 10.4, we need to switch the master to be db1130
When: Tuesday 22nd June at 05:00 AM UTC
Checklist:
[x] Double check db1130 has `report_host` enabled T271106
[x] Create a task to communicate the chosen date and send an announcement to the community: T284530
NEW master: db1130
OLD master: db1100
[] Check configuration differences between new and old master:
```
sudo pt-config-diff h=db1130.eqiad.wmnet,F=/root/.my.cnf h=db1100.eqiad.wmnet,F=/root/.my.cnf
```
**Failover prep:**
[] Silence alerts on all hosts:
```
sudo cookbook sre.hosts.downtime --hours 1 -r "Master switchover s5 T284529" 'A:db-section-s5'
```
[] Set NEW master with weight 0
```
sudo dbctl instance db1130 set-weight 0
sudo dbctl config commit -m "Set db1130 with weight 0 T284529"
```
[] Topology changes, move all replicas under NEW master
```
sudo db-switchover --timeout=15 --only-slave-move db1100.eqiad.wmnet db1130.eqiad.wmnet
```
[] Disable puppet on both nodes
```
sudo cumin 'db1100* or db1130*' 'disable-puppet "master switchover T284529"'
```
[] Merge gerrit puppet change to promote NEW master: TBD
**Failover:**
[] Log the failover:
```
!log Starting s5 eqiad failover from db1100 to db1130 - T284529
```
[] Set section read-only:
```
sudo dbctl --scope eqiad section s5 ro "Maintenance until 05:15 UTC - T284529"
sudo dbctl config commit -m "Set s5 eqiad as read-only for maintenance - T284529"
```
[] Check s5 is indeed read-only
[] Switch masters:
```
sudo db-switchover --skip-slave-move db1100 db1130
echo "===== db1100 (OLD)"; sudo mysql.py -h db1100 -e 'show slave status\G'
echo "===== db1130 (NEW)"; sudo mysql.py -h db1130 -e 'show slave status\G'
```
[] Promote NEW master in dbctl, and remove read-only
```
sudo dbctl --scope eqiad section s5 set-master db1130
sudo dbctl --scope eqiad section s5 rw
sudo dbctl config commit -m "Promote db1130 to s5 master and set section read-write T284529"
```
[] Restart puppet on both hosts (for heartbeat):
```
sudo cumin 'db1130* or db1100*' 'run-puppet-agent -e "master switchover T284529"'
```
**Clean up tasks:**
[] change events for query killer:
```
events_coredb_master.sql on the new master db1130
events_coredb_slave.sql on the new slave db1100
```
[] Update DNS: https://gerrit.wikimedia.org/r/c/operations/dns/+/699136/
[] Update candidate master dbctl notes
```
sudo dbctl instance db1100 set-candidate-master --section s5 true
sudo dbctl instance db1130 set-candidate-master --section s5 false
```
[] Check tendril was updated
[] Check zarcillo was updated
** Has to be done manually: https://phabricator.wikimedia.org/P13956
[] Depool OLD master, as it's running 10.1, replicating from a 10.4 master
```
sudo dbctl instance db1100 depool
sudo dbctl config commit -m "Depool db1100 until it's reimaged to buster T284529"
```
[] Apply T273360 T268392 T266486 T276150 to db1100
[] Update/resolve this ticket.