【环境说明】
上游(阿里云RDS):mysql 5.6.16-log
下游TiDB:v4.0.13
DM版本:v2.0.4
【DDL操作】
表结构:
CREATE TABLE mc_activity_assist_support
(
id
bigint(20) unsigned NOT NULL AUTO_INCREMENT,
activity_id
bigint(20) NOT NULL
cycle_no
varchar(100) NOT NULL,
city_code
varchar(20) NOT NULL,
user_no
bigint(20) NOT NULL,
user_phone
varchar(15) NOT NULL DEFAULT ‘’ ,
launch_user_no
bigint(20) NOT NULL ,
launch_user_phone
varchar(15) NOT NULL DEFAULT ‘’ ,
user_type
tinyint(3) unsigned NOT NULL DEFAULT ‘2’ ,
nick_name
varchar(255) NOT NULL DEFAULT ‘’,
headimg
varchar(255) NOT NULL DEFAULT ‘’ ,
assist_status
tinyint(3) unsigned NOT NULL DEFAULT ‘0’ ,
snapshot_info
text DEFAULT NULL ,
award_info
text DEFAULT NULL,
create_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP COMMENT ‘创建时间’,
update_time
timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP COMMENT ‘更新时间’,
PRIMARY KEY (id
),
KEY idx_activity_user
(activity_id
,cycle_no
,user_no
,user_type
),
KEY idx_activity_lanuch_user
(activity_id
,cycle_no
,launch_user_no
,user_type
),
KEY idx_create_time
(create_time
),
KEY idx_update_time
(update_time
),
KEY idx_activity_phone
(activity_id
,user_phone
),
KEY idx_activity_launch_phone
(activity_id
,launch_user_phone
),
KEY idx_activity_user_no
(activity_id
,user_no
),
KEY idx_activity_launch_user_no
(activity_id
,launch_user_no
)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin AUTO_INCREMENT=8279262;
使用gh-ost添加如下索引:
ALTER TABLE marketing_center
.mc_activity_assist_support
ADD INDEX idx_activity_create_time
(activity_id
, create_time
)
【复制报错】
[2021/08/08 02:19:26.702 +08:00] [ERROR] [streamer_controller.go:259] [“meet error when get binlog event”] [task=dm-rds_master] [unit=“binlog replication”] [error=“io.CopyN failed. err unexpected EOF, copied 0, expected 79: connection was bad”] [errorVerbose=“connection was bad
github.com/go-mysql-org/go-mysql/mysql.init
\t/go/pkg/mod/github.com/go-mysql-org/go-mysql@v1.1.3-0.20210519094347-5ec8d511f5be/mysql/error.go:10
runtime.doInit
\t/usr/local/go/src/runtime/proc.go:5222
runtime.doInit
\t/usr/local/go/src/runtime/proc.go:5217
runtime.doInit
\t/usr/local/go/src/runtime/proc.go:5217
runtime.doInit
\t/usr/local/go/src/runtime/proc.go:5217
runtime.main
\t/usr/local/go/src/runtime/proc.go:190
runtime.goexit
\t/usr/local/go/src/runtime/asm_amd64.s:1357
io.CopyN failed. err unexpected EOF, copied 0, expected 79
github.com/go-mysql-org/go-mysql/packet.(*Conn).ReadPacketTo
\t/go/pkg/mod/github.com/go-mysql-org/go-mysql@v1.1.3-0.20210519094347-5ec8d511f5be/packet/conn.go:151
github.com/go-mysql-org/go-mysql/packet.(*Conn).ReadPacketReuseMem
\t/go/pkg/mod/github.com/go-mysql-org/go-mysql@v1.1.3-0.20210519094347-5ec8d511f5be/packet/conn.go:98
github.com/go-mysql-org/go-mysql/packet.(*Conn).ReadPacket
\t/go/pkg/mod/github.com/go-mysql-org/go-mysql@v1.1.3-0.20210519094347-5ec8d511f5be/packet/conn.go:90
github.com/go-mysql-org/go-mysql/replication.(*BinlogSyncer).onStream
\t/go/pkg/mod/github.com/go-mysql-org/go-mysql@v1.1.3-0.20210519094347-5ec8d511f5be/replication/binlogsyncer.go:662
runtime.goexit
\t/usr/local/go/src/runtime/asm_amd64.s:1357”]
[2021/08/08 02:19:26.702 +08:00] [ERROR] [syncer.go:1507] [“fail to fetch binlog”] [task=dm-rds_master] [unit=“binlog replication”] [error=“io.CopyN failed. err unexpected EOF, copied 0, expected 79: connection was bad”]
详细见日志:worker.log (653.7 KB)
【问题】
从数据库监控上看当时并没有发现数据库指标异常,报错时binlog文件也是正常的,没有损坏的情况;出现这个中断一般是什么导致的?是否是触发了某个bug?
附binlog情况: