原sql是对表card_record 进行了两次alter操作 alter table card_record modify column customization_id bigint unsigned NOT NULL COMMENT '定制id' | 查看详情 alter table card_record modify column upgraded_customization_id bigint unsigned NOT NULL COMMENT '升级后定制id' | 查看详情
线上一次alter操作步骤是:
1、DROP TABLE IF EXISTS _card_record_gho
2、DROP TABLE IF EXISTS _card_record_del
3、create table yushitai_test._card_record_gho like yushitai_test.card_record
4、alter table yushitai_test._card_record_gho modify column customization_id bigint unsigned NOT NULL COMMENT 'ŚģöŚą∂id'
5、insert 数据到_card_record_gho
6、rename table yushitai_test.card_record to yushitai_test._card_record_del yushitai_test._card_record_gho to yushitai_test.card_record
手动设置位点到两条alter操作时间之前,重新消费时,当执行第二次alter 操作时,到步骤5时,会出现exception: fetch failed by table meta:yushitai_test._card_record_gho
2018-05-14 15:32:44.078 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_gho /* generated by server / 2018-05-14 15:32:44.078 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_del / generated by server / 2018-05-14 15:32:44.078 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_ghc / generated by server / 2018-05-14 15:32:44.079 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : create / gh-ost / table yushitai_test._card_record_ghc ( id bigint auto_increment, last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, hint varchar(64) charset ascii not null, value varchar(255) charset ascii not null, primary key(id), unique key hint_uidx(hint) ) auto_increment=256 2018-05-14 15:32:44.079 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : create / gh-ost / table yushitai_test._card_record_gho like yushitai_test.card_record 2018-05-14 15:32:44.080 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : alter / gh-ost / table yushitai_test._card_record_gho modify column customization_id bigint unsigned NOT NULL COMMENT 'ŚģöŚą∂id' 2018-05-14 15:32:44.085 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : create / gh-ost / table yushitai_test._card_record_del ( id int auto_increment primary key ) engine=InnoDB comment='ghost-cut-over-sentry' 2018-05-14 15:32:44.090 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_del / generated by server / 2018-05-14 15:32:44.090 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : rename / gh-ost / table yushitai_test.card_record to yushitai_test._card_record_del, yushitai_test._card_record_gho to yushitai_test.card_record 2018-05-14 15:32:44.091 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_ghc / generated by server / 2018-05-14 15:32:44.104 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : rename table _card_record_del to _card_record_del_bak20180508125310 2018-05-14 15:32:45.093 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_gho / generated by server / 2018-05-14 15:32:45.094 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_del / generated by server / 2018-05-14 15:32:45.094 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : DROP TABLE IF EXISTS _card_record_ghc / generated by server / 2018-05-14 15:32:45.096 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : create / gh-ost / table yushitai_test._card_record_ghc ( id bigint auto_increment, last_update timestamp not null DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, hint varchar(64) charset ascii not null, value varchar(255) charset ascii not null, primary key(id), unique key hint_uidx(hint) ) auto_increment=256 2018-05-14 15:32:45.096 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : create / gh-ost / table yushitai_test._card_record_gho like yushitai_test.card_record 2018-05-14 15:32:45.097 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.o.canal.parse.inbound.mysql.tsdb.DatabaseTableMeta - dup apply for sql : alter / gh-ost */ table yushitai_test._card_record_gho modify column upgraded_customization_id bigint unsigned NOT NULL COMMENT 'ŚćáÁļߌźéŚģöŚą∂id' 2018-05-14 15:32:45.103 [destination = yushitai_test , address = /10.32.200.228:5002 , EventParser] WARN c.a.otter.canal.parse.inbound.mysql.MysqlEventParser - ERROR ## parse this event has an error , last position : [EntryPosition[included=false,journalName=mysql-bin.000056,position=286998741,serverId=32114196,timestamp=1525755246000]] com.alibaba.otter.canal.parse.exception.CanalParseException: parse row data failed. Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: com.alibaba.otter.canal.parse.exception.CanalParseException: fetch failed by table meta:yushitai_test._card_record_gho Caused by: com.alibaba.otter.canal.parse.exception.CanalParseException: fetch failed by table meta:yushitai_test._card_record_gho Caused by: java.io.IOException: ErrorPacket [errorNumber=1146, fieldCount=-1, message=Table 'yushitai_test._card_record_gho' doesn't exist, sqlState=42S02, sqlStateMarker=#] with command: show create table yushitai_test._card_record_gho at com.alibaba.otter.canal.parse.driver.mysql.MysqlQueryExecutor.query(MysqlQueryExecutor.java:61) ~[canal.parse.driver-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.query(MysqlConnection.java:94) [canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.TableMetaCache.getTableMeta(TableMetaCache.java:167) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.getTableMeta(LogEventConvert.java:759) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parseRowsEvent(LogEventConvert.java:428) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parse(LogEventConvert.java:114) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.dbsync.LogEventConvert.parse(LogEventConvert.java:66) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser.parseAndProfilingIfNecessary(AbstractEventParser.java:337) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3$1.sink(AbstractEventParser.java:184) ~[canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.mysql.MysqlConnection.dump(MysqlConnection.java:152) [canal.parse-1.0.26-SNAPSHOT.jar:na] at com.alibaba.otter.canal.parse.inbound.AbstractEventParser$3.run(AbstractEventParser.java:220) [canal.parse-1.0.26-SNAPSHOT.jar:na] at java.lang.Thread.run(Thread.java:745) [na:1.8.0_45]
原提问者GitHub用户yueapple
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。