I have the following setup: 5 hosts, each of them running two galera clusters. One of those two clusters has a production database, the second one a test database. Once a week (early monday morning), the test database gets cleared and filled from the production database.
Shortly before midnight, I use mysqldump
to dump the production database, a few hours later, I drop the tables in test and re-fill them from the production dump.
Doing this while the whole galera cluster is running is quite unfeasable because it takes a lot longer than just filling a single node + resyncing the others (using wsrep_sst
). So I shutdown 4 of the 5 databases first, fill the 5th, then start the other 4 again, one by one.
Now, my problem is, the single node still knows it's a galera node, so it'll log all the inserts to galera.cache
and, when that one fills, to many many gcache.page
files. Those files are never used though, as the other nodes, when they rejoin the cluster, will just do the wsrep_sst
to rsync everything.
This is a problem because all those files mean a lot of unneccesary writes, and rsync picks them up, syncing them to the rejoining nodes (which takes more unneccesary time and disk writes), and it seems like each node mmap's all of them, resulting in the processes being much larger than they should be; my production mariadb processes are ~60 GB in size, while the test processes are ~250 GB.
So what I'm doing right now is, after filling the single test node, shut it down, remove all those gcache.page files, start it up again, then start the other nodes.
But I'd rather prevent those files from being written at all. Is there any way to do that?
Galera version is 26.4.10, mariadb version 10.6.5.