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