Page MenuHomePhabricator

Switchover s5 from db1100 to db1130
Open, MediumPublic


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


  • Double check db1130 has report_host enabled T271106
  • 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


  • 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 -h db1100 -e 'show slave status\G'
echo "===== db1130 (NEW)"; sudo -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
sudo dbctl instance db1100 set-candidate-master --section s5 true
sudo dbctl instance db1130 set-candidate-master --section s5 false
sudo dbctl instance db1100 depool
sudo dbctl config commit -m "Depool db1100 until it's reimaged to buster T284529"

Event Timeline

Marostegui triaged this task as Medium priority.Tue, Jun 8, 6:28 AM
Marostegui updated the task description. (Show Details)
Marostegui moved this task from Triage to Ready on the DBA board.

Change 699136 had a related patch set uploaded (by Marostegui; author: Marostegui):

[operations/dns@master] wmnet: Promote db1130 to s5 master