We'll only support full backup in the first iteration, to incrementals or partials .
what needs to be done
During mariabackup --backup
when mariabackup --backup starts
check if rocksdb plugin is installed
*in the "synch" phase, under "flush tables with readlock, lock binlog"
if (rocksdb_present) {
|
if (backup to directory) {
|
execute SET GLOBAL rocksdb_create_checkpoint=<backup-dir>/#rocksdb
|
// this will create rocksdb subdirectory in the backup dir, we're done
|
}
|
else {// backup to stdio with xbstream
|
execute SET GLOBAL rocksdb_create_checkpoint=<temp-dir>/#rocksdb
|
copy <temp-dir>/#rocksdb recursively in xbstream format to stdout
|
remove <temp-dir>/#rocksdb
|
}
|
}
|
Do we need a parameter for whether to backup rocksdb or not?
Do we need a parameter for rocksdb temp-dir, in case backup is streaming?. It is beneficial temp directory is on the same volume, checkpoint will create hardlinks rather than copy.
During mariabackup copy-back
- copy <backup-dir>/#rocksdb to the rocksdb-data-dir (in absense of this parameter to <target-dir>/#rocksdb)
That's it.
Note from wlad: Alibaba has added TokuDB backup support into xtrabackup: https://github.com/alibaba/AliSQLBackup/commit/26573de135d115b100dbbfb9698274463ade5c8d . So we are not the first.