Page MenuHomePhabricator

Setup x4 backups
Closed, ResolvedPublic

Description

x4 has been split from s4 and it is now a production section.
We'd need to setup backups for it like we have in any other section.

For reference, the host that reflects the reality of what this section will store is db1260 which has been already cleaned up.

Event Timeline

Would it be possible to get a "clean" version of x4, one on each datacenter, to copy it to backup sources? Alternatively, could I have some of your time to discuss if that should be the way to go, or if we should clone and clean the backup sources to generate these new instances, based on a compromise & understanding between what is the best way for DBAs and backup maintainers so I can take care of it?

Yes, there is already a clean version in db1260 (T437278) and we'll soon have one in codfw too.
I'd suggest you simply clone from that host and the one in codfw, which I will provide as soon as we have it.
I am waiting for confirmation from @Ladsgroup that we can proceed with db1260, as I also need it for sanitarium. I will ping here once ready.

When it is ready, please let me also know if it is safe to run xtrabackup on that host or if it would need depool, etc. That way I make sure I don't break anything while cloning it. Also if it would need any different setup other than replicating from the same place that the origin host would need. Thank you.

When it is ready, please let me also know if it is safe to run xtrabackup on that host or if it would need depool, etc. That way I make sure I don't break anything while cloning it. Also if it would need any different setup other than replicating from the same place that the origin host would need. Thank you.

That host is now serving production traffic, so it should be treated like any other production traffic host. Having said that, it is probably safe to run xtrabackup as the locking is going to be just minimal at the end.
There's no specific setup needed, it can be treated like any other backup in production coming from a sX.

safe to run xtrabackup as the locking is going to be just minimal at the end

Yes, there is minimal locking, but my main worry is throttling bandwidth, as otherwise it goes as fast as resources are available, potentially causing performance issues during the full cycle. But knowing it is in production I can work with that, and tune it or workaround it. I will be careful and announce it loudly when maintenance starts, out of precaution. I need to learn a bit the existing topology first.

I got green light from Amir, so I am going to clone it for sanitarium and I'll let you know when done. Shouldn't take long.

Not in a rush, I don't even have production access, so take all the time you need :-D.

I am going to add the following backup sources:

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

[operations/puppet@production] db2250: Remove s5

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

Change #1343932 merged by Marostegui:

[operations/puppet@production] db2250: Remove s5

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

Marostegui triaged this task as Medium priority.Sep 23 2026, 7:48 AM
Marostegui added a project: DBA.
Marostegui moved this task from Triage to In progress on the DBA board.

Mentioned in SAL (#wikimedia-operations) [2026-10-07T04:51:19Z] <marostegui@cumin1004> START - Cookbook sre.mysql.depool depool db2245: to clone the backup host T437279

Mentioned in SAL (#wikimedia-operations) [2026-10-07T04:51:32Z] <marostegui@cumin1004> END (PASS) - Cookbook sre.mysql.depool (exit_code=0) depool db2245: to clone the backup host T437279

Mentioned in SAL (#wikimedia-operations) [2026-10-07T04:54:37Z] <marostegui> Stop mariadb on x4 db2245 to clone the backup host T437279

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

[operations/puppet@production] db2250: Add x4 to backups

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

Change #1352343 merged by Marostegui:

[operations/puppet@production] db2250: Add x4 to backups

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

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

[operations/puppet@production] site.pp: Update backups on db2250

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

Change #1352352 merged by Marostegui:

[operations/puppet@production] site.pp: Update backups on db2250

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

db2250 is now replicating x4. I've also added the dump and mediabackup grants.

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

[operations/puppet@production] db1265: Change buffer pool for s4 and s3

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

Change #1352895 merged by Marostegui:

[operations/puppet@production] db1265: Change buffer pool for s4 and s3

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

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

[operations/puppet@production] mariadb: Add x4 codfw backups

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

Change #1352900 merged by Marostegui:

[operations/puppet@production] mariadb: Add x4 codfw backups

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

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

[operations/puppet@production] db1265: Add x4 backup

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

Change #1352920 merged by Marostegui:

[operations/puppet@production] db1265: Add x4 backup

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

db1265:3364 now replicating x4.

I am running a manual snapshot generation in codfw for x4.

codfw snapshot finished correctly:

root@cumin2003:~# remote-backup-mariadb x4
[07:20:52]: INFO - Create a new empty directory at dbprov2005.codfw.wmnet
[07:20:52]: INFO - Executing commands [cumin.transports.Command('/bin/mkdir /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52')] on '1' hosts: dbprov2005.codfw.wmnet
[07:20:53]: INFO - Completed command '/bin/mkdir /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52'
[07:20:53]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/bin/mkdir /srv/...-10-08--07-20-52'.
[07:20:53]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[07:20:53]: INFO - Running XtraBackup at db2250.codfw.wmnet:3364 and sending it to dbprov2005.codfw.wmnet



[08:30:42]: INFO - Making the resulting dir owned by someone else than root
[08:30:42]: INFO - Executing commands [cumin.transports.Command('/bin/chown --recursive dump:dump /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52')] on '1' hosts: dbprov2005.codfw.wmnet
[08:30:43]: INFO - Completed command '/bin/chown --recursive dump:dump /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52'
[08:30:43]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/bin/chown --rec...-10-08--07-20-52'.
[08:30:43]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[08:30:43]: INFO - Preparing backup at dbprov2005.codfw.wmnet
[08:30:43]: INFO - Executing commands [cumin.transports.Command('/usr/bin/sudo --user dump backup-mariadb /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52 --type snapshot --only-postprocess --backup-dir /srv/backups/snapshots/ongoing --host db2250.codfw.wmnet --port 3364 --threads 16 --rotate --retention 5 --compress --stats-file /etc/wmfbackups/statistics.ini')] on '1' hosts: dbprov2005.codfw.wmnet



[09:12:05]: INFO - Completed command '/usr/bin/sudo --user dump backup-mariadb /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--07-20-52 --type snapshot --only-postprocess --backup-dir /srv/backups/snapshots/ongoing --host db2250.codfw.wmnet --port 3364 --threads 16 --rotate --retention 5 --compress --stats-file /etc/wmfbackups/statistics.ini'
[09:12:05]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/usr/bin/sudo --...s/statistics.ini'.
[09:12:05]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[09:12:05]: INFO - All 1 backup(s) sent to dbprov2005.codfw.wmnet finished
[09:12:05]: INFO - All 1 configured backup(s) run finished correctly

Checking the DB:

| 42920 | snapshot.x4.2026-10-08--07-20-52         | finished | db2250.codfw.wmnet:3364 | dbprov2005.codfw.wmnet | snapshot | x4             | 2026-10-08 08:30:44 | 2026-10-08 09:12:05 | 1134737273039 |

Next I will run a logical dump

The check also worked fine:

[09:19:55] marostegui@backupmon1001:~$ sudo -u backupcheck /usr/bin/check-mariadb-backups \
  --config-file=/etc/wmfbackups/backups_check.ini \
  --section=x4 --datacenter=codfw --type=snapshot \
  --freshness=259200 --min-size=307200 \
  --warn-size-percentage=5 --crit-size-percentage=15
There is only 1 snapshot for x4 at codfw (db2250) taken on 2026-10-08 08:30:44 (1057 GiB)

The alert on backupmon1001 cleared for x4 codfw

Captura de pantalla 2026-10-08 a las 11.24.01.png (1,666×28 px, 13 KB)

The logicaldump worked fine on codfw too:

root@dbprov2005:/etc# sudo -u dump backup-mariadb --config-file="$DUMPHOME/x4-only.cnf"
root@dbprov2005:/etc#  ls /srv/backups/dumps/latest/ | grep x4
dump.x4.2026-10-08--09-22-15
[09:19:59] marostegui@backupmon1001:~$ sudo -u backupcheck /usr/bin/check-mariadb-backups --config-file=/etc/wmfbackups/backups_check.ini --section=x4 --datacenter=codfw --type=dump --freshness=777600 --min-size=307200 --warn-size-percentage=5 --crit-size-percentage=15
There is only 1 dump for x4 at codfw (db2250) taken on 2026-10-08 09:22:15 (70 GiB)

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

[operations/puppet@production] cumin1004.cnf: Add x4 backup

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

Change #1353106 merged by Marostegui:

[operations/puppet@production] cumin1004.cnf: Add x4 backup

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

Starting a manual run in eqiad for both snapshot and logical

eqiad snapshot went fine:

[11:01:38] marostegui@cumin1004:~$ sudo remote-backup-mariadb x4
[11:11:15]: INFO - Create a new empty directory at dbprov1005.eqiad.wmnet
[11:11:15]: INFO - Executing commands [cumin.transports.Command('/bin/mkdir /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15')] on '1' hosts: dbprov1005.eqiad.wmnet
[11:11:16]: INFO - Completed command '/bin/mkdir /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15'
[11:11:16]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/bin/mkdir /srv/...-10-08--11-11-15'.
[11:11:16]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[11:11:16]: INFO - Running XtraBackup at db1265.eqiad.wmnet:3364 and sending it to dbprov1005.eqiad.wmnet
[12:18:10]: INFO - Making the resulting dir owned by someone else than root
[12:18:10]: INFO - Executing commands [cumin.transports.Command('/bin/chown --recursive dump:dump /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15')] on '1' hosts: dbprov1005.eqiad.wmnet
[12:18:11]: INFO - Completed command '/bin/chown --recursive dump:dump /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15'
[12:18:11]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/bin/chown --rec...-10-08--11-11-15'.
[12:18:11]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[12:18:11]: INFO - Preparing backup at dbprov1005.eqiad.wmnet
[12:18:11]: INFO - Executing commands [cumin.transports.Command('/usr/bin/sudo --user dump backup-mariadb /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15 --type snapshot --only-postprocess --backup-dir /srv/backups/snapshots/ongoing --host db1265.eqiad.wmnet --port 3364 --threads 16 --rotate --retention 5 --compress --stats-file /etc/wmfbackups/statistics.ini')] on '1' hosts: dbprov1005.eqiad.wmnet
[12:55:56]: INFO - Completed command '/usr/bin/sudo --user dump backup-mariadb /srv/backups/snapshots/ongoing/snapshot.x4.2026-10-08--11-11-15 --type snapshot --only-postprocess --backup-dir /srv/backups/snapshots/ongoing --host db1265.eqiad.wmnet --port 3364 --threads 16 --rotate --retention 5 --compress --stats-file /etc/wmfbackups/statistics.ini'
[12:55:56]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) for command #1: '/usr/bin/sudo --...s/statistics.ini'.
[12:55:56]: INFO - 100.0% (1/1) success ratio (>= 100.0% threshold) of nodes successfully executed all commands.
[12:55:56]: INFO - All 1 backup(s) sent to dbprov1005.eqiad.wmnet finished
[12:55:56]: INFO - All 1 configured backup(s) run finished correctly




[12:58:01] marostegui@backupmon1001:~$ sudo -u backupcheck /usr/bin/check-mariadb-backups --config-file=/etc/wmfbackups/backups_check.ini --section=x4 --datacenter=eqiad --type=snapshot --freshness=259200 --min-size=307200 --warn-size-percentage=5 --crit-size-percentage=15
There is only 1 snapshot for x4 at eqiad (db1265) taken on 2026-10-08 12:18:12 (1055 GiB)

[12:57:32] marostegui@dbprov1005:~$ sudo ls -lh /srv/backups/snapshots/latest/ | grep x4
-rw-r--r-- 1 dump dump 269G Oct  8 12:55 snapshot.x4.2026-10-08--11-11-15.tar.gz
[12:57:35] marostegui@dbprov1005:~$ sudo ls /srv/backups/snapshots/ongoing/ | grep x4
[12:57:40] marostegui@dbprov1005:~$
| 42922 | snapshot.x4.2026-10-08--11-11-15         | finished | db1265.eqiad.wmnet:3364 | dbprov1005.eqiad.wmnet | snapshot | x4             | 2026-10-08 12:18:12 | 2026-10-08 12:55:56 | 1132940249647 |

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

[operations/puppet@production] dbprov1005.cnf.erb: Add eqiad x4

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

Change #1353209 merged by Marostegui:

[operations/puppet@production] dbprov1005.cnf.erb: Add eqiad x4

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

eqiad logical dump went fine:

root@dbprov1005:~# sudo -u dump backup-mariadb --config-file="$DUMPHOME/x4-only.cnf"
root@dbprov1005:~#
root@dbprov1005:~# cat $DUMPHOME/x4-only.cnf
archive: false
compress: false
password: xxx
retention: 18
rotate: true
sections:
  x4:
    host: db1265.eqiad.wmnet
    port: 3364
stats_file: /etc/wmfbackups/statistics.ini
type: dump
user: dump



[05:52:11] marostegui@backupmon1001:~$ sudo -u backupcheck /usr/bin/check-mariadb-backups --config-file=/etc/wmfbackups/backups_check.ini --section=x4 --datacenter=eqiad --type=dump --freshness=777600 --min-size=307200 --warn-size-percentage=5 --crit-size-percentage=15
There is only 1 dump for x4 at eqiad (db1265) taken on 2026-10-08 13:53:38 (70 GiB)


| 42924 | dump.x4.2026-10-08--13-53-38             | finished | db1265.eqiad.wmnet:3364 | dbprov1005.eqiad.wmnet | dump     | x4             | 2026-10-08 13:53:38 | 2026-10-08 15:33:31 |   74822024494 |

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

[operations/puppet@production] monitoring.yaml: Add eqiad x4

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

Change #1353750 merged by Marostegui:

[operations/puppet@production] monitoring.yaml: Add eqiad x4

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

Marostegui claimed this task.

All done