日韩性视频-久久久蜜桃-www中文字幕-在线中文字幕av-亚洲欧美一区二区三区四区-撸久久-香蕉视频一区-久久无码精品丰满人妻-国产高潮av-激情福利社-日韩av网址大全-国产精品久久999-日本五十路在线-性欧美在线-久久99精品波多结衣一区-男女午夜免费视频-黑人极品ⅴideos精品欧美棵-人人妻人人澡人人爽精品欧美一区-日韩一区在线看-欧美a级在线免费观看

歡迎訪問(wèn) 生活随笔!

生活随笔

當(dāng)前位置: 首頁(yè) > 编程资源 > 编程问答 >内容正文

编程问答

pt-archiver 数据归档bug

發(fā)布時(shí)間:2024/1/17 编程问答 47 豆豆
生活随笔 收集整理的這篇文章主要介紹了 pt-archiver 数据归档bug 小編覺(jué)得挺不錯(cuò)的,現(xiàn)在分享給大家,幫大家做個(gè)參考.

2019獨(dú)角獸企業(yè)重金招聘Python工程師標(biāo)準(zhǔn)>>>

前言:今天在進(jìn)行線上數(shù)據(jù)庫(kù)數(shù)據(jù)歸檔的時(shí)候發(fā)現(xiàn)個(gè)問(wèn)題,ID最大的那一列數(shù)據(jù)沒(méi)有歸檔到其他實(shí)例,下面是現(xiàn)場(chǎng)及解決辦法

?

現(xiàn)場(chǎng):

root@localhost:mysql.sock 10:18:07 [tom]>select count(*) from test; +----------+ | count(*) | +----------+ | 88787 | +----------+ 1 row in set (0.09 sec)[root@redis02 ~]# pt-archiver --source h=10.0.0.6,u=root,p=123456,D=tom,t=test,A=utf8 --dest h=10.0.0.7,P=3306,D=tom,t=test --where "1=1" --share-lock --statistics --progress 5000 --limit 5000 --txn-size 5000 TIME ELAPSED COUNT 2017-07-25T10:36:54 0 0 2017-07-25T10:37:07 13 5000 2017-07-25T10:37:21 26 10000 2017-07-25T10:37:36 42 15000 2017-07-25T10:37:50 55 20000 2017-07-25T10:38:02 67 25000 2017-07-25T10:38:14 80 30000 2017-07-25T10:38:26 92 35000 2017-07-25T10:38:39 105 40000 2017-07-25T10:38:52 117 45000 2017-07-25T10:39:03 129 50000 2017-07-25T10:39:15 141 55000 2017-07-25T10:39:27 152 60000 2017-07-25T10:39:38 164 65000 2017-07-25T10:39:51 177 70000 2017-07-25T10:40:04 189 75000 2017-07-25T10:40:16 202 80000 2017-07-25T10:40:29 214 85000 2017-07-25T10:40:38 224 88786 Started at 2017-07-25T10:36:54, ended at 2017-07-25T10:40:38 Source: A=utf8,D=tom,h=10.0.0.6,p=...,t=test,u=root Dest: A=utf8,D=tom,P=3306,h=10.0.0.7,p=...,t=test,u=root SELECT 88786 INSERT 88786 DELETE 88786 Action Count Time Pct deleting 88786 122.6957 54.70 inserting 88786 66.5441 29.67 select 19 2.0529 0.92 commit 36 0.4159 0.19 other 0 32.5878 14.53root@localhost:mysql.sock 10:40:51 [tom]>select * from test; +-------+------------+------+---------------------+ | id | name | age | createtime | +-------+------------+------+---------------------+ | 88787 | hello88787 | 83 | 2017-07-19 17:24:21 | +-------+------------+------+---------------------+ 1 row in set (0.00 sec)

what?居然有一條還在,看下pt-archiver相關(guān)代碼

6257 $first_sql .= " AND ($col < " . $q->quote_val($val) . ")";

把這個(gè)修改一下,讓它小于等于就ok了

6257 $first_sql .= " AND ($col <= " . $q->quote_val($val) . ")";

然后重新執(zhí)行

[root@redis02 ~]# pt-archiver --source h=10.0.0.7,u=root,p=123456,D=tom,t=test,A=utf8 --dest h=10.0.0.6,P=3306,D=tom,t=test --where "1=1" --statistics --progress 10000 --limit 10000 --txn-size 5000 --no-delete TIME ELAPSED COUNT 2017-07-25T10:58:48 0 0 2017-07-25T10:59:00 12 10000 2017-07-25T10:59:10 22 20000 2017-07-25T10:59:19 30 30000 2017-07-25T10:59:32 44 40000 2017-07-25T10:59:46 58 50000 2017-07-25T11:00:00 72 60000 2017-07-25T11:00:12 84 70000 2017-07-25T11:00:24 96 80000 2017-07-25T11:00:36 108 88786 Started at 2017-07-25T10:58:48, ended at 2017-07-25T11:00:36 Source: A=utf8,D=tom,h=10.0.0.7,p=...,t=test,u=root Dest: A=utf8,D=tom,P=3306,h=10.0.0.6,p=...,t=test,u=root SELECT 88786 INSERT 88786 DELETE 0 Action Count Time Pct inserting 88786 88.3225 81.45 select 10 0.4881 0.45 commit 36 0.2246 0.21 other 0 19.4023 17.89

ok ?,至此問(wèn)題完美解決

為了方便大家交流,本人開(kāi)通了微信公眾號(hào),和QQ群291519319。喜歡技術(shù)的一起來(lái)交流吧

轉(zhuǎn)載于:https://my.oschina.net/u/3023401/blog/1486759

總結(jié)

以上是生活随笔為你收集整理的pt-archiver 数据归档bug的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。

如果覺(jué)得生活随笔網(wǎng)站內(nèi)容還不錯(cuò),歡迎將生活随笔推薦給好友。