Innobackupex – Apply-log Before Emergency Restore or After Each Backup?

backupinnodbMySQLperconaxtrabackupxtradb-cluster

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?

Best Answer

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).