Page MenuHomePhabricator

Switchover m1 master (db1164 -> db1213)
Closed, ResolvedPublic

Description

Impact: Read only for a few seconds on the services below:

Services running on m1:

  • bacula
  • cas (and cas staging)
  • backups
  • etherpad
  • librenms
  • pki
  • rt

Switchover steps:

OLD MASTER: db1164

NEW MASTER: db1213

  • Check configuration differences between new and old master pt-config-diff h=db1213.eqiad.wmnet,F=/root/.my.cnf h=db1164.eqiad.wmnet,F=/root/.my.cnf
  • Enable notifications on db1213
  • Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --hours 1 -r "Primary switchover m1 T434493" 'A:db-section-m1'
  • Topology changes: move everything under db1213

sudo db-switchover --timeout=1 --only-slave-move db1164.eqiad.wmnet db1213.eqiad.wmnet

run-puppet-agent && cat /etc/haproxy/conf.d/db-master.cfg

  • Start the failover

!log Failover m1 from db1164 to db1213 - T434493

root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# sudo db-switchover --skip-slave-move db1164 db1213
  • Reload haproxies
dbproxy1022:   systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
dbproxy1024:   systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
  • kill connections on the old master (db1164)

pt-kill --print --kill --victims all --match-all F=/dev/null,S=/run/mysqld/mysqld.sock

  • Restart puppet on old and new masters (for heartbeat):db1164 and db1213

sudo cumin 'db1213* or db1164*' 'run-puppet-agent -e "primary switchover T434493"'

  • Check services affected (librenms, racktables, etherpad...)
  • Clean orchestrator heartbeat to remove the old masters' one: sudo db-mysql db1213 heartbeat -e "delete from heartbeat where file like 'db1164%';"
  • Merge backup ticket: https://gerrit.wikimedia.org/r/c/operations/puppet/+/1324263
  • Update/resolve phabricator ticket about failover

Details

Event Timeline

Marostegui triaged this task as Medium priority.Aug 11 2026, 9:24 AM
Marostegui updated the task description. (Show Details)
Marostegui updated the task description. (Show Details)
Marostegui moved this task from Triage to In progress on the DBA board.

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

[operations/puppet@production] mariadb: Promote db1213 to m1 master

https://gerrit.wikimedia.org/r/1324271

Mentioned in SAL (#wikimedia-operations) [2026-08-11T09:54:37Z] <marostegui@cumin1003> DONE (PASS) - Cookbook sre.hosts.downtime (exit_code=0) for 1:00:00 on db[2160,2232].codfw.wmnet,db[1164,1213,1217].eqiad.wmnet with reason: Primary switchover m1 T434493

Change #1324271 merged by Marostegui:

[operations/puppet@production] mariadb: Promote db1213 to m1 master

https://gerrit.wikimedia.org/r/1324271

Mentioned in SAL (#wikimedia-operations) [2026-08-11T09:57:56Z] <marostegui> Failover m1 from db1164 to db1213 - T434493

Marostegui updated the task description. (Show Details)