Quantcast
Channel: Active questions tagged zfs - Server Fault
Viewing all articles
Browse latest Browse all 143

Backing up a MySQL/MariaDB database via ZFS snapshots without errors

$
0
0

So I am using zrepl to take snapshots of my production machine and replicate them to a backup server. This also includes MariaDB, it's in it's own dataset with recordsize=16k

I've been testing the snapshots today to see if I could mount one snapshot on the backup server to dump one table to file but whenever I start MariaDB I always get errors like:

[Note] InnoDB: Starting crash recovery from checkpoint LSN=xxxxxx[Note] InnoDB: To recover: LSN xxxxxxInnoDB: At LSN: 15347562372082: unable to open file ./<dbname>/#sql-ib93859.ibd for tablespace 93856

Because the backup machine only has slow HDDs it takes forever to recover and actually boot up MariaDB. Not 100% about DB integrity at this point.

I am running FLUSH TABLES WITH READ LOCK before the snapshot and UNLOCK TABLES after. However my mysql log dir is in a different ZFS dataset (recordsize=128k) as recommended by OpenZFS and many others.

I also use innodb_flush_log_at_trx_commit=0.

Could my issue be that ib_logfile0 is in a different dataset? Meaning zrepl probably runs FLUSH TABLES per dataset. So between the two snapshots it could have unlocked the tables for a split second and written some stuff to the logfile?

If so. Would innodb_flush_log_at_trx_commit=2 fix it or is the only option moving ib_logfile0 back into the same dataset as the MariaDB datadir?

In case of the latter, are there any performance drawbacks of having the log on recordsize 16k versus 128k?


Viewing all articles
Browse latest Browse all 143

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>