<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    posts - 88, comments - 3, trackbacks - 0, articles - 0
      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理

    innobackupex & FLUSH TABLES WITH READ LOCK

    Posted on 2012-04-10 17:19 Milo的海域 閱讀(669) 評論(0)  編輯  收藏 所屬分類: MySQL
    當innobackupex 做全備的時候(my version 1.6.5), 當備份到MyISAM數(shù)據(jù)時, innobackupex 會flush tables with read lock, 來禁止MyISAM的寫操作. (假設(shè)沒有--no-lock選項)

    sub backup {

        
    if (!$option_incremental && !$option_no_lock) {
            
    # make a prep copy before locking tables, if using rsync
            backup_files(1);

            
    # flush tables with read lock
            mysql_lockall();
        }

        
    if ($option_slave_info) {
            write_slave_info();
        }

    }

    sub mysql_lockall {

        
    if (compare_versions($mysql_server_version, '4.0.22'== 0
            
    || compare_versions($mysql_server_version, '4.1.7'== 0) {
            
    # MySQL server version is 4.0.22 or 4.1.7
            mysql_send "COMMIT;";
            mysql_send 
    "FLUSH TABLES WITH READ LOCK;";
        } 
    else {
            
    # MySQL server version is other than 4.0.22 or 4.1.7
            mysql_send "FLUSH TABLES WITH READ LOCK;";
            mysql_send 
    "COMMIT;";
        }
        write_binlog_info;


    }

    但是如果備份的時候還有很重的workload, "flush tables with read lock" 可能會比較耗時. 這里參考了:

    http://www.mysqlperformanceblog.com/2010/04/24/how-fast-is-flush-tables-with-read-lock/

    看了下--no-lock的選項說明:

        --no-lock
            Use this option to disable table lock with 
    "FLUSH TABLES WITH READ
            LOCK
    ". Use it only if ALL your tables are InnoDB and you DO NOT CARE
            about the binary log position of the backup.

    如果我們能保證workload僅僅是innodb相關(guān)的,我們可以使用這個選項。

    記得在1.5版本的時候,使用--no-lock選項會導(dǎo)致xtrabackup_slave_info沒有保存?zhèn)浞輹r的logfile & pos. 這個問題在1.6.5被解決了

        if ($option_slave_info) {
            write_slave_info();
        }

    xtrabackup_slave_info & xtrabackup_binlog_info文件在1.5版本是在mysql_lockall函數(shù)里更新的。但是新版本已經(jīng)把write_slave_info提到mysql_lockall外面了。
    主站蜘蛛池模板: 免费夜色污私人影院在线观看| 国内精品99亚洲免费高清| 色天使亚洲综合一区二区| 丝袜熟女国偷自产中文字幕亚洲| 成人片黄网站色大片免费观看APP| 精品亚洲成在人线AV无码| 亚洲va中文字幕无码| 久久久久久曰本AV免费免费| 日日摸日日碰夜夜爽亚洲| 亚洲国产国产综合一区首页| 大陆一级毛片免费视频观看| 国产又黄又爽胸又大免费视频 | 亚洲一卡2卡3卡4卡5卡6卡| 亚洲人成网站观看在线播放| 精品无码免费专区毛片| 未满十八私人高清免费影院| 亚洲成a人片在线网站| 亚洲区不卡顿区在线观看| 最新中文字幕电影免费观看| 天黑黑影院在线观看视频高清免费| 亚洲国产91在线| 久久精品国产亚洲| 一本久久综合亚洲鲁鲁五月天 | 国产精品亚洲一区二区三区在线 | 亚洲国产精品无码久久久秋霞2| 免费看少妇作爱视频| 最近免费中文在线视频| 野花香高清视频在线观看免费 | 国产成人免费网站| 久久久久久免费一区二区三区 | 综合偷自拍亚洲乱中文字幕| 亚洲精品中文字幕无码AV| 激情综合色五月丁香六月亚洲| 性xxxx视频播放免费| 91免费国产精品| 好久久免费视频高清| 日日摸夜夜添夜夜免费视频| 亚洲成aⅴ人片久青草影院按摩| 亚洲一区中文字幕在线电影网| 亚洲伊人久久大香线蕉苏妲己| 亚洲日韩精品无码一区二区三区|