Log Archiving for xtrabackup: restoring
Implement the possibility of applying archived logs.
The following options should be implemented and used only with --prepare option:
--archived-
--to-archived-lsn - lsn to which logs should be applied
The important feature of logs applying must be ability to apply log files incremental.
Blueprint information
- Status:
- Complete
- Approver:
- Alexey Kopytov
- Priority:
- Essential
- Drafter:
- None
- Direction:
- Approved
- Assignee:
- Vlad Lesin
- Definition:
- Approved
- Series goal:
- Accepted for 2.1
- Implementation:
- Implemented
- Milestone target:
- 2.1.5
- Started by
- Alexey Kopytov
- Completed by
- Alexey Kopytov
Related branches
Related bugs
Sprints
Whiteboard
To apply archive logs there should be path to base backup and path to the folder with archived logs as an input of xtrabackup. The output is the base directory with data files. The following new command line options are involved:
--archived-logs-dir - the path of stored log archives
--archived-max-lsn - the maximum LSN to which logs must be applied
Those options can be used only with --prepare.
Example:
xtrabackup --prepare --target-
Logs are applied in innodb_
The stack trace of log group initialization is innobase_
The main trouble here is log_sys is initialized inside of innobase_
The uncovered question is how to modify archived logs and data files to make recovering work.
Vlad Lesin UPD:
There are some changes which were involved during feature implementation and code exploring.
1) The main thing we should split backup preparing and archived log applying. Those are logically different operations. Backup preparing is an operation to restore data consistency. Archived logs applying is a kind of incremental backup, it should apply delta to existing (and consistency) data. We can apply archived logs to backuped data several times for example for decreasing backup size or time of applying.
2) We don't need to work with log groups at all. It's enough just to read log data to some buffer and invoke recv_scan_