Basically Percona Innobackupex consist with three steps: 1. Backup 2. Apply log 3. Copy back restore during emergency

My question: When should I do apply log? Is it after each backup or before emergency restore?


If you apply the redo log right after a backup copy is taken you can greatly reduce time to restore.

Sometimes --apply-log step fails. Due to a bug or tablespace corruption. In either case you don't want to learn that in the emergency. That's one more argument to do the --apply-log after the backup.

People don't apply the redo log because it brings in more complexity to the backup process. For example, you cannot stream and apply the log. If you take incremental backups the --apply-log makes it even more complex and you loose any intermediate recovery points (at best you'll have a state as of full backup time and the most current state. It may be OK though).

  • for my case, it make sense not apply log before emergency happen. May I know if it's possible to test apply-log each time after backup is done? – Thomas G. Lau Jun 10 '15 at 11:52
  • Well, you can take a copy of the backup, test the apply-log and trash it. This is something unusual though. Would you mind describing what you want to achieve? – akuzminsky Jun 10 '15 at 16:15
  • I want to ensure backup is not corrupted. After you said apply log might fail, I am little bit scare, so I want to know if it's possible to test apply log. – Thomas G. Lau Jun 11 '15 at 0:27
  • Then take a backup, apply the log and store it until you need it. This way you'll be sure --apply-log succeeds and the restore time will decrease. When you need to restore just copy the backup copy to datadir, change ownership to mysql and you're ready to go. – akuzminsky Jun 11 '15 at 0:40
  • but for incremental backup, I can't do apply log right? – Thomas G. Lau Jun 11 '15 at 1:05

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.