亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb

首頁 > 數據庫 > 文庫 > 正文

pt-online-schema-change 利用異常處理及注意事宜

2024-09-07 22:12:36
字體:
來源:轉載
供稿:網友

         pt-online-schema-change最近使用pt-online-schema-change 做線上大表的在線DDL,發現幾個問題。
        我使用的語句如下:
        pt-online-schema-change --user=root --password="xxxxx" --host=192.168.xx.xx D=M_xx,t=T_xx  --alter "ADD Fxxxxx'" --charset=utf8 --no-check-replication-filters --alter-foreign-keys-method=auto --recursion-method=none --print --execute
        在執行的過程中,有一個庫中斷了,錯誤信息如下:
Copying `table_01005`.`T_xxx`:  19% 16:30 remain
Copying `table_01005`.`T_xxx`:  21% 16:21 remain
Copying `table_01005`.`T_xxx`:  22% 16:58 remain
2014-11-04T18:20:25 Dropping triggers...
DROP TRIGGER IF EXISTS `table_01005`.`pt_osc_table_01005_T_xxx_del`;
DROP TRIGGER IF EXISTS `table_01005`.`pt_osc_table_01005_T_xxx_upd`;
DROP TRIGGER IF EXISTS `table_01005`.`pt_osc_table_01005_T_xxx_ins`;
2014-11-04T18:20:28 Dropped triggers OK.
2014-11-04T18:20:28 Dropping new table...
DROP TABLE IF EXISTS `table_01005`.`_T_xxx_new`;
2014-11-04T18:20:30 Dropped new table OK.
`table_01005`.`T_xxx` was not altered.
2014-11-04T18:20:25 Error copying rows from `table_01005`.`T_xxx` to `table_01005`.`_T_xxx_new`: Threads_running=199 exceeds its critical threshold 50。
 
       然后就中斷了,這個Threads_running 是活動的線程數。根據這個錯誤提示,查了下percona的文檔,
       簡單的根據錯誤提示查看bug列表,找到一個bug,根據現象說是工具本身的一個bug。也正好和我們使用的版本一致,
       那我就升級版本,完了再來,然后又重現了,顯示不是bug這么簡單的事。還是再看錯誤信息,提示為Threads_running 超過了警告的閥值。既然是閥值,
       那是不是可以設置了,找來官網文檔仔細瞅瞅,里面有一個參數需要注意,--critical-load 。文檔解釋如下:
--critical-load
type: Array; default: Threads_running=50
Examine SHOW GLOBAL STATUS after every chunk,
and abort if the load is too high. The option accepts a comma-separated list of MySQL status variables and thresholds.
An optional =MAX_VALUE (or :MAX_VALUE) can follow each variable. If not given,
the tool determines a threshold by examining the current value at startup and doubling it.
See --max-load for further details. These options work similarly,
except that this option will abort the tool’s operation instead of pausing it,
 and the default value is computed differently if you specify no threshold.
 The reason for this option is as a safety check in case the triggers on the
 original table add so much load to the server that it causes downtime.
 There is probably no single value of Threads_running that is wrong for
 every server, but a default of 50 seems likely to be unacceptably high
 for most servers, indicating that the operation should be canceled immediately.
 
大致的意思如下:
每次chunk操作前后,會根據show global status統計指定的狀態量的變化,默認是統計Thread_running。
目的是為了安全,防止原始表上的觸發器引起負載過高。這也是為了防止在線DDL對線上的影響。
超過設置的閥值,就會終止操作,在線DDL就會中斷。提示的異常如上報錯信息。
 
和這個參數有的類似的還有一個--max-load :
--max-load
type: Array; default: Threads_running=25
Examine SHOW GLOBAL STATUS after every chunk, and pause if any status variables are higher than their thresholds.
The option accepts a comma-separated list of MySQL status variables. An optional =MAX_VALUE (or :MAX_VALUE) can
follow each variable. If not given, the tool determines a threshold by examining the current value and increasing it by 20%.
 
For example, if you want the tool to pause when Threads_connected gets too high, you can specify “Threads_connected”,
 and the tool will check the current value when it starts working and add 20% to that value. If the current value is 100,
 then the tool will pause when Threads_connected exceeds 120, and resume working when it is below 120 again. If you want to
 specify an explicit threshold, such as 110, you can use either “Threads_connected:110” or “Threads_connected=110”.
 
The purpose of this option is to prevent the tool from adding too much load to the server. If the data-copy queries are
intrusive, or if they cause lock waits, then other queries on the server will tend to block and queue. This will typically
cause Threads_running to increase, and the tool can detect that by running SHOW GLOBAL STATUS immediately after each query finishes.
If you specify a threshold for this variable, then you can instruct the tool to wait until queries are running normally again. This will
not prevent queueing, however; it will only give the server a chance to recover from the queueing. If you notice queueing, it is best to decrease the chunk time.
 
--max-load 選項定義一個閥值,在每次chunk操作后,查看show global status狀態值是否高于指定的閥值。該參數接受一個mysql status狀態變量以及一個閥值,
如果沒有給定閥值,則定義一個閥值為為高于當前值的20%。
注意這個參數不會像--critical-load終止操作,而只是暫停操作。當status值低于閥值時,則繼續往下操作。
是暫停還是終止操作這是--max-load和--critical-load的差別。
 
參數值為列表形式,可以指定show global status出現的狀態值。比如,Thread_connect 等等。
格式如下:--critical-load="Threads_running=200"  或者--critical-load="Threads_running:200"。
 
根據參數要求,修改了Threads_runnings的閥值,成功執行了。所以文檔還是很重要的,在使用一個工具之前,文檔是必須要看的,
而不只是簡單的使用就完事,必須要對使用過程中可能出現的異常錯誤進行處理。
 
幾個注意事項:
 
The tool refuses to operate if it detects replication filters. See --[no]check-replication-filters for details.
The tool pauses the data copy operation if it observes any replicas that are delayed in replication. See --max-lag for details.
The tool pauses or aborts its operation if it detects too much load on the server. See --max-load and --critical-load for details.
The tool sets its lock wait timeout to 1 second so that it is more likely to be the victim of any lock contention, and less likely to disrupt other transactions. See --lock-wait-timeout for details.
The tool refuses to alter the table if foreign key constraints reference it, unless you specify --alter-foreign-keys-method.
The tool cannot alter MyISAM tables on “Percona XtraDB Cluster” nodes.
 
pt-online-schema-change 在線DDL工具,雖然說不會鎖表,但是對性能還是有一定的影響,執行過程中對全表做一次select。
這個過程會將buffer_cache中活躍數據全部交換一遍,這就導致活躍數據的請求都要從磁盤獲取,導致慢SQL增多,file_reads增大。

(編輯:武林網)

發表評論 共有條評論
用戶名: 密碼:
驗證碼: 匿名發表
亚洲香蕉成人av网站在线观看_欧美精品成人91久久久久久久_久久久久久久久久久亚洲_热久久视久久精品18亚洲精品_国产精自产拍久久久久久_亚洲色图国产精品_91精品国产网站_中文字幕欧美日韩精品_国产精品久久久久久亚洲调教_国产精品久久一区_性夜试看影院91社区_97在线观看视频国产_68精品久久久久久欧美_欧美精品在线观看_国产精品一区二区久久精品_欧美老女人bb
成人性教育视频在线观看| 九九久久综合网站| 成人h猎奇视频网站| 91色在线视频| 91国产精品视频在线| 亚洲老板91色精品久久| 青青在线视频一区二区三区| 久久偷看各类女兵18女厕嘘嘘| 欧美日韩999| 欧美亚洲成人xxx| 亚洲天堂男人的天堂| 成人黄色免费看| 久久久亚洲福利精品午夜| 国产欧美欧洲在线观看| 在线免费观看羞羞视频一区二区| 日韩欧美国产黄色| 51视频国产精品一区二区| 日韩天堂在线视频| 国产69精品久久久久久| 国产精品免费电影| 国产福利精品视频| 日本一区二区不卡| 超碰91人人草人人干| 91国产中文字幕| 性欧美xxxx视频在线观看| 亚洲高清福利视频| 亚洲精品www久久久久久广东| 久久久久久久97| 久久精品免费电影| 欧美在线免费观看| 欧美—级高清免费播放| 亚洲精品资源美女情侣酒店| 国产精品ⅴa在线观看h| 欧美肥老妇视频| 日本一区二区三区四区视频| 国产精品久久久久久久app| 欧洲永久精品大片ww免费漫画| 欧美日韩福利电影| 成人激情在线观看| 国产精品扒开腿做爽爽爽男男| 有码中文亚洲精品| 日韩欧美国产高清91| 91手机视频在线观看| 欧美日韩成人黄色| 日韩欧美在线视频| 亚洲黄色av网站| 38少妇精品导航| 亚洲欧洲日产国码av系列天堂| 两个人的视频www国产精品| 国产日韩精品电影| 国产精品亚洲综合天堂夜夜| 91老司机精品视频| 亚洲性69xxxbbb| 日韩黄色av网站| 色偷偷偷亚洲综合网另类| 日韩在线高清视频| 色综合伊人色综合网站| 2019中文字幕免费视频| 中文字幕日韩有码| 国产成人综合一区二区三区| 国产精品午夜一区二区欲梦| 国产精品中文字幕在线观看| 日本精品免费一区二区三区| 久久亚洲欧美日韩精品专区| 伊人久久大香线蕉av一区二区| 欧美专区福利在线| 欧美日韩在线视频首页| 欧美成人三级视频网站| 色婷婷亚洲mv天堂mv在影片| 欧美激情精品在线| 亚洲成人免费在线视频| 久久久久久久久久久91| 奇米影视亚洲狠狠色| 亚洲精品电影网在线观看| 国产精品永久免费| 欧美大秀在线观看| 日韩男女性生活视频| 国产精品嫩草影院久久久| 96pao国产成视频永久免费| 国产日韩在线一区| 欧美性猛交xxxx| 亚洲三级 欧美三级| 欧美亚洲免费电影| 国产亚洲欧美aaaa| 国产精品视频免费在线| 久久亚洲精品网站| 亚洲国产美女久久久久| 午夜精品三级视频福利| 国产性猛交xxxx免费看久久| 亚洲成av人影院在线观看| 88xx成人精品| 国产精品7m视频| 欧美精品免费在线观看| 国产视频精品一区二区三区| 久久久精品久久| 欧美一区二区三区免费视| 国产精品青草久久久久福利99| 成人伊人精品色xxxx视频| 91精品视频免费看| 91青草视频久久| 欧洲成人免费aa| 51视频国产精品一区二区| 久久国产色av| 欧美大秀在线观看| 国产精品偷伦视频免费观看国产| 日韩欧美在线观看视频| 国产主播喷水一区二区| 欧美日韩国产成人在线观看| 国产99在线|中文| 成人网址在线观看| 亚洲精品美女免费| 精品中文字幕视频| 在线性视频日韩欧美| 亚洲精品免费在线视频| 国产精品国产福利国产秒拍| 中文字幕无线精品亚洲乱码一区| 国产福利视频一区| 国产精品7m视频| 久久综合久久88| 日韩网站免费观看高清| 久久影院资源网| 欧美亚洲国产视频| 亚洲自拍中文字幕| 欧美乱大交xxxxx| 欧美尤物巨大精品爽| 成人精品一区二区三区电影免费| 色噜噜久久综合伊人一本| 欧美电影《睫毛膏》| 日韩欧美中文免费| 欧美极品美女视频网站在线观看免费| 亚洲欧美日韩精品久久| 国产精品99久久久久久久久| 中文字幕欧美国内| 91九色蝌蚪国产| 在线看国产精品| 精品国产乱码久久久久久婷婷| 国模视频一区二区三区| 国产精品第2页| 国产精品av网站| 欧美精品video| 久久免费国产精品1| 97视频国产在线| 国产福利精品av综合导导航| 亚洲乱码国产乱码精品精| 久久频这里精品99香蕉| 久久亚洲精品一区二区| 77777亚洲午夜久久多人| 日韩av免费网站| 亚洲日本中文字幕| 国产精品女人久久久久久| 最近2019免费中文字幕视频三| 2019最新中文字幕| 欧美精品久久久久a| 色播久久人人爽人人爽人人片视av| 久久精品久久久久| 日韩一级裸体免费视频| 日韩av男人的天堂| 中文字幕日韩av综合精品| 国产精品中文字幕在线| 成人网在线免费观看| 亚洲美女av在线播放| 国产一区二区三区在线播放免费观看| 成人免费视频在线观看超级碰| 久久久免费电影|