AWS DMS迁移表莫名报错列数不匹配

问题描述:

AWS DMS去执行一个表的fullload+cdc任务,但是很多次莫名发现这个表报错,而且是一开始没有报错,后续会报错。报错信息就是列数不匹配。

报错信息:

00713562: 2024-07-11T15:40:07 [SOURCE_CAPTURE  ]W:  Mismatch number of columns in table test.test1: CDC event has 5 columns while Replicate knows 4. Only the first 4 columns will be replicated. This may imply that DDL changes were done and reverted when the task did not run.  (mysql_endpoint_capture.c:1496)
00713562: 2024-07-11T15:40:07 [SOURCE_CAPTURE  ]W:  Error parsing column 'col1' in table 'test1' - overflow occurred  (mysql_endpoint_capture.c:2795)
00713562: 2024-07-11T15:40:07 [DMS_INTERNAL    ]I:  Event (first 2048 bytes): 

00713562: 2024-07-11T15:40:07 [SOURCE_CAPTURE  ]W:  Suspending table 'test1', table id '34'  (mysql_endpoint_capture.c:1770)
00713522: 2024-07-11T15:40:07 [TASK_MANAGER    ]W:  Table 'test'.'test1' was errored/suspended (subtask 0 thread 0).   (replicationtask.c:3045)

分析过程 及 解决方案:

表面上,出现这个报错,大家就不会从报错继续往下查了,一般就认为是我们自己无意中在源端或者目标端更改了table DDL,源端增加或者目标端去掉了一列。

但是其实问题不是这么简单,哪怕选择reload任务表也还是会出错。

那么如何深入排查呢?

是这样:通过这个表的名字,比如test.test1, 搜索一下日志。会发现如下一个报错,还是个warning, 不是error:

00722269: 2024-07-11T07:41:56 [SOURCE_UNLOAD   ]W:  Column 'col1' was removed from table definition 'test.test1': the column data type is LOB and the table has no primary key or unique index  (metadatamanager.c:3105)

通过这个报错,查看这个DMS任务的设置,发现任务的LOB部分确实是设置成LimitedSizeLobMode

AWS有个博客上这样写了,不在官方文档里:

Full load and CDC: Require primary key (otherwise remove LOB column for both full load and CDC phase if no primary key)

所以,这个问题的原因很简单,就是DMS任务源端的这张表里有LOB字段,同时还没有Primary Key,所以在目标端就被drop了,DMS迁移任务是首先迁移没有LOB字段的列的,因此DMS任务启动以后的一段时间内这个表不会报错,但是终究还是会因为LOB列被drop而报错。

  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值