Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

i have doubts about xtrabackup --apply-log. is there any difference when use it? should it be done right after dump or before restore (even few months later)? seems stupid, but maybe i missing something.

documentation says this:

Prepare a backup in BACKUP-DIR by applying the transaction log file named xtrabackup_logfile located in the same directory. Also, create new transaction logs. The InnoDB configuration is read from the file backup-my.cnf created by innobackupex when the backup was made.

thanks for help :)

share|improve this question
add comment

3 Answers

The chief reason to use --apply-log until the time of restore is to support incremental backups.

If you make incremental backups, you would use --apply-log --redo-only each incremental backup, and then just before you restore, you do a final prepare with --apply-log.

Otherwise if you don't make incremental backups, there's no reason not to do --apply-log right after you make the back up. Then it's ready to restore on a moment's notice.

share|improve this answer
add comment

PURE OPERATIONAL STANDPOINT

You need to decide which protocol works best for you

PLAN A : AFTER DUMP

Run --apply-log immediately after backup, and you would have the most currently full backup. You would not have to spend your recovery time applying applying logs at the time of a restore (especially at an actual disaster recovery event). Thus, recovery would be only focus at such a dire time.

PLAN B : BEFORE RESTORE

This might work to your advantage if and only if you do not need the transactions that were accumulated after the point-in-time start of the backup. Such a situation would hardly make sense in a write-heavy environment.

Perhaps under these circumstances it would be better

  • Scheduled downtime
  • Small enough dataset
  • Acceptable window of time to backup (short time)
  • Additional backup of binary logs (extra insurance)

EPILOGUE

Whichever way one choose, make sure all the logs are good. If you apply the logs immediately, you'll know right then and there if the transaction logs are corrupt or not.

You also need to take into account how transaction-heavy the production system is. Why?

If the backup is recording incoming transactions as fast or faster than the backup process, then you have no choice but to go with PLAN B.

share|improve this answer
add comment

found answer here. short is "you can do apply-log whenever you want", more useful informetion in link.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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