[MDEV-23947] reflink support for mariabackup Created: 2020-10-12 Updated: 2023-11-30 |
|
| Status: | Open |
| Project: | MariaDB Server |
| Component/s: | Backup |
| Fix Version/s: | None |
| Type: | New Feature | Priority: | Minor |
| Reporter: | Matthias Blümel | Assignee: | Unassigned |
| Resolution: | Unresolved | Votes: | 0 |
| Labels: | backup, enhancement | ||
| Description |
|
Hi folks, would it be possible to implement a way to use reflink for mariabackup on filesystems which support it like btrfs and xfs? The benefit of this woud be that, on systems where the database is installed on a filesystem with reflink-support, the backup could be done within parts of a second without the need of additional space no matter how big the database is (and if the backup-destination is on the same filesystem). On systems where the local backup is only used temporarily until it gets uploaded to a backup-store this is absolutely fine and can save a lot of I/O and time. You can even use this to "clone" a database e.g. for testing purpouse without the need of additional space (backup a single db and restore it with a different name using cp --reflink during restore) |
| Comments |
| Comment by Daniel Black [ 2022-06-17 ] |
|
Implementation tips from marko regarding implementation in extra/mariabackup: If we invoked copy_file_range() on the ib_logfile0, we would still have to read and parse that file in --backup. So, it might be better to invoke it for any other file only. The datasink_struct interface would have to be refactored to allow copy_file_range. The DS_TYPE_LOCAL would have to be replaced with copy_file_range when it is detected at compilation time. Maybe also DS_TYPE_STDOUT and a few others could be replaced by that. Read/write loops e.g. xtrabackup_copy_logfile with a new ds_copy_file_range, if exists, otherwise fallback. |