Page MenuHomePhabricator

Switchover m5 master db1164 -> db1228
Closed, ResolvedPublic

Description

Databases on m5:

labsdbaccounts
mailman3
mailman3web
striker
test_labsdbaccounts
toolhub

Impact: Writes will be disabled for around 15-30 seconds.

Failover process

OLD MASTER: db1164

NEW MASTER: db1228

  • Check configuration differences between new and old master

pt-config-diff h=db1164.eqiad.wmnet,F=/root/.my.cnf h=db1228.eqiad.wmnet,F=/root/.my.cnf

  • Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --minutes 60 -r "m5 master switch T432967" 'A:db-section-m5'
  • Topology changes: move everything under db1228

sudo db-switchover --timeout=15 --only-slave-move db1164.eqiad.wmnet db1228.eqiad.wmnet

  • Disable puppet db1164 and db1228 sudo cumin 'db1164* or db1228*' 'disable-puppet "primary switchover T432967"'
  • Merge gerrit: https://gerrit.wikimedia.org/r/1318563
  • Run puppet on dbproxy1027 and dbproxy1029 and check the config

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

  • Start the failover: !log Failover m5 from db1164 to db1228 - T432967
  • DB switchover

root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# db-switchover --skip-slave-move db1164 db1228

  • Reload haproxies (dbproxy1029 is the active one)
dbproxy1027:   systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
dbproxy1029:   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 db1228 sudo cumin 'db1164* or db1228*' 'run-puppet-agent -e "primary switchover T432967"'
  • Check affected services
  • Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag:
    • sudo db-mysql db1228 heartbeat -e "delete from heartbeat where file like 'db1164%';"

Event Timeline

Marostegui updated the task description. (Show Details)
Marostegui moved this task from Triage to In progress on the DBA board.

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

[operations/puppet@production] m5 proxies: Test db1228

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

Change #1315835 merged by Marostegui:

[operations/puppet@production] m5 proxies: Test db1228

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

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

[operations/puppet@production] m5 dbproxies: Revert changes

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

Change #1315848 merged by Marostegui:

[operations/puppet@production] m5 dbproxies: Revert changes

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

Mentioned in SAL (#wikimedia-operations) [2026-07-28T06:39:30Z] <marostegui@cumin1003> DONE (PASS) - Cookbook sre.hosts.downtime (exit_code=0) for 1:00:00 on db[2160,2235].codfw.wmnet,db[1164,1217,1228].eqiad.wmnet with reason: m5 master switch T432967

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

[operations/puppet@production] mariadb: Promote db1228 to m5 master

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

Change #1318563 merged by Marostegui:

[operations/puppet@production] mariadb: Promote db1228 to m5 master

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

Mentioned in SAL (#wikimedia-operations) [2026-07-28T06:44:02Z] <marostegui> Failover m5 from db1164 to db1228 - T432967

Marostegui updated the task description. (Show Details)

This was done

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

[operations/puppet@production] mariadb: Enable notifications on m5 master

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

Change #1318566 merged by Marostegui:

[operations/puppet@production] mariadb: Enable notifications on m5 master

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