When: Thu 25th 06:00 AM UTC
NEW primary: es1023
OLD primary: es1024
- Check configuration differences between new and old primary:
sudo pt-config-diff --defaults-file /root/.my.cnf h=es1023.eqiad.wmnet h=es1024.eqiad.wmnet
Failover prep:
- Disable writes to es5 by merging this patch: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/825328
- Check there are no writes
- Silence alerts on all hosts:
sudo cookbook sre.hosts.downtime --hours 2 -r "Switchover es5 T315542" 'A:db-section-es5'
- Set NEW primary with weight 10
sudo dbctl instance es1024 set-weight 10 sudo dbctl config commit -m "Set es1024 with weight 10 T315542"
- Topology changes, move all replicas under NEW primary
sudo db-switchover --timeout=15 --only-slave-move es1023 es1024
- Disable puppet on both nodes
sudo cumin 'es1023* or es1024*' 'disable-puppet "primary switchover T315542"'
- Merge gerrit puppet change to promote NEW primary: https://gerrit.wikimedia.org/r/c/operations/puppet/+/825330/
Failover:
- Log the failover:
!log Starting es5 eqiad failover from es1023 to es1024 - T315542
- Switch primaries:
sudo db-switchover --skip-slave-move es1023 es1024 echo "===== es1023 (OLD)"; sudo db-mysql es1023 -e 'show slave status\G' echo "===== es1024 (NEW)"; sudo db-mysql es1024 -e 'show slave status\G'
- Promote NEW primary in dbctl, and remove read-only
sudo dbctl --scope eqiad section es5 set-master es1024 sudo dbctl config commit -m "Promote es1024 to es5 primary T315542"
- Restart puppet on both hosts:
sudo cumin 'es1023* or es1024*' 'run-puppet-agent -e "primary switchover T315542"'
Clean up tasks:
- Clean up heartbeat table(s).
- change events for query killer:
events_coredb_master.sql on the new primary es1024 events_coredb_slave.sql on the new slave es1023
- Update DNS: https://gerrit.wikimedia.org/r/c/operations/dns/+/825331
- Re-enable writes on es5: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/825274
- Update candidate primary dbctl notes and orchestrator
sudo dbctl instance es1023 set-candidate-master --section es5 true sudo dbctl instance es1024 set-candidate-master --section es5 false (dborch1001): sudo orchestrator-client -c untag -i es1024 --tag name=candidate (dborch1001): sudo orchestrator-client -c tag -i es1023 --tag name=candidate
- Check zarcillo was updated
- db-switchover should do this. If it fails, do it manually: https://phabricator.wikimedia.org/P13956
- Depool OLD primary for reboot
sudo dbctl instance es1023 depool sudo dbctl config commit -m "Depool es1023 for reboot T315542"