MySQL 5.5 Community Server
MySQL 5.6 Community Server
Percona Configuration Wizard
XtraBackup 搭建主从复制
Great Sites on MySQL
Percona
MySQL Performance Blog
Severalnines
推荐管理工具
Sequel Pro
phpMyAdmin
推荐书目
MySQL Cookbook
MySQL 相关项目
MariaDB
Drizzle
参考文档
http://mysql-python.sourceforge.net/MySQLdb.html
pythonee
V2EX  ›  MySQL

xtrabackup 备份为什么要--prepare,增量合并的时候为什么需要--apply-log-only 呢?

  •  
  •   pythonee · Jul 4, 2017 · 3808 views
    This topic created in 3257 days ago, the information mentioned may be changed or developed.
    --prepare 主要是做什么动作?我只找到这么一句话
    "because they were copied at different times as the program ran, and they might have been changed while this was happening. If you try to start InnoDB with these data files, it will detect corruption and crash itself to prevent you from running on damaged data."

    意思是说,全量备份完成时,整个备份集是不可用的,为什么不可用呢?

    --apply-log-only 应该是为了保留未提交的事务,因为有可能在下一次增量的时候,进行提交,按这种逻辑,应该最后一次增量也需要做这个动作,为什么文档建议最后一次增量合并不加这个参数呢
    3 replies    2018-09-07 15:03:19 +08:00
    julyclyde
        1
    julyclyde  
       Jul 5, 2017
    因为没 apply log 所以不可用
    pythonee
        2
    pythonee  
    OP
       Jul 5, 2017
    @julyclyde 嗯,我的疑问是为什么没有建议最后一次增量备份也用这个参数呢,这个参数是为了防止增量备份合并的时候回滚事务,还是在增量合并的时候回滚事务呢
    auroracxy
        3
    auroracxy  
       Sep 7, 2018
    @pythonee 我的理解是:最后一次"准备"操作可以不用跳过回滚操作,这样用来恢复的数据文件本地就处理好了,当服务启动后就不会再进入到回滚阶段,如果最后一次使用了这个参数,服务器启动后将进入回滚阶段。所以这个--apply-log-only 只是用来合并增量用的避免下一个增量不可用。 参见 man xtrabackup
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5012 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 40ms · UTC 03:58 · PVG 11:58 · LAX 20:58 · JFK 23:58
    ♥ Do have faith in what you're doing.