Part of T300006: Upgrade es5 to Bullseye
When: FIXME
Checklist:
- Create a task to communicate the chosen date and send an announcement to the community: FIXME
- Create a calendar entry for the maintenance, invite sre-data-persistence@
- Add to deployments calendar. E.g.:
{{Deployment calendar event card |when=2021-08-24 23:00 SF |length=0.5 |window=Database primary switchover for s7 |who={{ircnick|kormat|Stevie Beth Mhaol}}, {{ircnick|marostegui|Manuel 'Early Bird' Arostegui}}, {{ircnick|Amir1|Amir}} |what=https://phabricator.wikimedia.org/T300006 }}
NEW primary: es1023
OLD primary: es1024
- Check configuration differences between new and old primary:
sudo pt-config-diff --defaults-file /root/.my.cnf h=es1024.eqiad.wmnet h=es1023.eqiad.wmnet
Failover prep:
- Silence alerts on all hosts:
sudo cookbook sre.hosts.downtime --hours 1 -r "Primary switchover es5 T300006" 'A:db-section-es5'
- Set NEW primary with weight 0
sudo dbctl instance es1023 set-weight 0 sudo dbctl config commit -m "Set es1023 with weight 0 T300006"
- Topology changes, move all replicas under NEW primary
sudo db-switchover --timeout=15 --only-slave-move es1024 es1023
- Disable puppet on both nodes
sudo cumin 'es1024* or es1023*' 'disable-puppet "primary switchover T300006"'
- Merge gerrit puppet change to promote NEW primary: https://gerrit.wikimedia.org/r/c/operations/puppet/+/762558
Failover:
- Log the failover:
!log Starting es5 eqiad failover from es1024 to es1023 - T300006
- Set section read-only: https://gerrit.wikimedia.org/r/c/operations/mediawiki-config/+/762557
sudo dbctl --scope eqiad section es5 ro "Maintenance until 05:15 UTC - T300006" sudo dbctl config commit -m "Set es5 eqiad as read-only for maintenance - T300006"
- Check es5 is indeed read-only
- Switch primaries:
sudo db-switchover --skip-slave-move es1024 es1023 echo "===== es1024 (OLD)"; sudo db-mysql es1024 -e 'show slave status\G' echo "===== es1023 (NEW)"; sudo db-mysql es1023 -e 'show slave status\G'
- Promote NEW primary in dbctl, and remove read-only
sudo dbctl --scope eqiad section es5 set-master es1023 sudo dbctl --scope eqiad section es5 rw sudo dbctl config commit -m "Promote es1023 to es5 primary and set section read-write T300006"
- Restart puppet on both hosts:
sudo cumin 'es1024* or es1023*' 'run-puppet-agent -e "primary switchover T300006"'
Clean up tasks:
- Clean up heartbeat table(s).
- change events for query killer:
events_coredb_master.sql on the new primary es1023 events_coredb_slave.sql on the new slave es1024
- Update DNS: https://gerrit.wikimedia.org/r/762779
- Update candidate primary dbctl notes
sudo dbctl instance es1024 set-candidate-master --section es5 true sudo dbctl instance es1023 set-candidate-master --section es5 false
- Check zarcillo was updated
- db-switchover should do this. If it fails, do it manually: https://phabricator.wikimedia.org/P13956
- (If needed): Depool es1024 for maintenance.
sudo dbctl instance es1024 depool sudo dbctl config commit -m "Depool es1024 T300006"
- Apply outstanding schema changes to es1024 (if any)
- Update/resolve this ticket.