Page MenuHomePhabricator

Switchover m3 master db1119 -> db1159
Closed, ResolvedPublic

Description

Databases on m3: phabricator
When: TBD
Impact: Writes will be disabled for around 1 minute.

Failover process

OLD MASTER: db1119

NEW MASTER: db1159

  • Check configuration differences between new and old master

$ pt-config-diff h=db1119.eqiad.wmnet,F=/root/.my.cnf h=db1159.eqiad.wmnet,F=/root/.my.cnf

  • Silence alerts on all hosts: sudo cookbook sre.hosts.downtime --hours 1 -r "m3 master switchover T352149" 'A:db-section-m3'
  • Topology changes: move everything under db1159

db-switchover --timeout=15 --only-slave-move db1119.eqiad.wmnet db1159.eqiad.wmnet

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

  • Start the failover: !log Failover m3 from db1119 to db1159 - T352360
  • Set phabricator in RO:
ssh phab1004
    sudo /srv/phab/phabricator/bin/config set cluster.read-only true
    # restart database server
    sudo /srv/phab/phabricator/bin/config set cluster.read-only false
  • DB switchover

root@cumin1001:~/wmfmariadbpy/wmfmariadbpy# db-switchover --skip-slave-move db1119 db1159

  • Reload haproxies
dbproxy1026:   systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
dbproxy1020:   systemctl reload haproxy && echo "show stat" | socat /run/haproxy/haproxy.sock stdio
  • kill connections on the old master (db1119)

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):db1159 and db1119 sudo cumin 'db1159* or db1119*' 'run-puppet-agent -e "primary switchover T352360"'
  • Check services affected: phabricator
  • Clean orchestrator heartbeat to remove the old masters' one, otherwise Orchestrator will show lag: delete from heartbeat where server_id=171966512;

Event Timeline

Marostegui triaged this task as Medium priority.Nov 30 2023, 6:04 AM
Marostegui updated the task description. (Show Details)
Marostegui moved this task from Triage to In progress on the DBA board.

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

[operations/puppet@production] phabricator.my.cnf.erb: Increase innodb_buffer_pool_size

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

Change 978850 merged by Marostegui:

[operations/puppet@production] phabricator.my.cnf.erb: Increase innodb_buffer_pool_size

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

After the switch over, Phabricator reported some configuration issue (in the form of a yellow warning at the top of the web ui). That linked to https://phabricator.wikimedia.org/config/issue/ which gave two items:

MySQL STRICT_ALL_TABLES Mode Not Set
MySQL is not in strict mode (on host "m3-master.eqiad.wmnet:3306"), but using strict mode is recommended.

Unsafe MySQL "local_infile" Setting Enabled
MySQL STRICT_ALL_TABLES Mode Not Set

I have poked @Marostegui about it and both got resolved.

Thanks for letting me know. The old master, will be back tomorrow anyways :)

Mentioned in SAL (#wikimedia-operations) [2023-12-01T05:37:10Z] <marostegui> Failover m3 from db1119 to db1159 - T352360

Marostegui updated the task description. (Show Details)
Marostegui updated the task description. (Show Details)

All done