细节
-
错误
-
状态: Done">完成
-
媒介
-
解决方法: 固定
-
没有一个
-
没有一个
描述
pt-online-schema-changept-online-schema-change——no-use-insert-ignore坏了:
- 没有插入语句可以在——no-use-insert-ignore
- 更新而且删除只能在已复制的行上执行。
如何繁殖:
mysql >…删除数据库pt;创建数据库pt;使用pt创建表test (id int主键auto_increment, otherid int);插入测试值(null,null);Insert into test select nullInsert into test select nullInsert into test select nullInsert into test select nullInsert into test select null insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; insert into test select null, null from test; update test set otherid=id;
——version pt-online-schema-change 3.0.3
# touch /tmp/ptosc. #暂停;# pt-online-schema-change——pause-file=/tmp/ptosc。execute D=pt,t=test——alter "添加唯一键(otherid)"没有发现奴隶。参见——recursion-method,如果主机percon雷竞技下载官网aserver有slave。没有检查slave lag,因为没有找到slave,并且没有指定——check-slave-lag。操作,尝试,等待:analyze_table, 10,1 copy_rows, 10,0.25 create_triggers, 10,1 drop_triggers, 10,1 swap_tables, 10,1 update_foreign_keys, 10,1正在修改' pt ' . ' test '…正在创建新表…创建新表pt._test_new OK。修改新表… Altered `pt`.`_test_new` OK. 2017-06-13T20:28:11 Creating triggers... 2017-06-13T20:28:11 Created triggers OK. 2017-06-13T20:28:11 Copying approximately 262682 rows... Sleeping 60 seconds because /tmp/ptosc.pause exists
当你听到这个…
在另一个终端:
insert into pt.test values (null, 10000000);"# rm /tmp/ pscc .pause
这将创建一行。表上的触发器会将其复制到新表中。
....
然后在另一个终端:
复制“pt”。' test ': 0% 04:21:16 remain 2017-06-13T20:32:51删除触发器…2017-06-13T20:32:51删除触发器OK。2017-06-13T20:32:51删除新表…2017-06-13T20:32:51删除新表OK。“pt”。' test '没有改变。2017-06-13T20:32:51从“pt”中复制行错误。' test '到' pt '。' _test_new ': 2017-06-13T20:32:51 DBD::mysql::st execute failed: Duplicate entry '458732' for key 'PRIMARY' [for Statement "INSERT LOW_PRIORITY INTO ' pt ' .]“_test_new”(“id”,“otherid”)选择“id”,“otherid”从“pt”。' test ' FORCE INDEX(' PRIMARY ') WHERE ((' id ' >= ?)) AND ((' id ' <= ?)) LOCK IN SHARE MODE /*pt-online-schema-change 4241 copy nibble*/" with ParamValues: 0='368360', 1='458732'] at /bin/pt-online-schema-change line 11011。
因为插入忽略不使用,就会失败……
学分主要为dov.endress及队伍图集(bradley.mickel,emanuel.calvo,maxbube,dov.endress,marcelo.goncalves)