Update 语句 出现Lost connection to MySQL server during query错误

为提高效率,提问时请尽量提供详细背景信息,问题描述清晰可优先响应。以下信息点请尽量提供:

  • 系统版本 & kernel 版本
    centos 7.0
  • TiDB 版本
    3.0
  • 磁盘型号
  • 集群节点分布
    2tidb 3pd 5tikv 1haproxy
  • 数据量 & region 数量 & 副本数
    数据量480w条
  • 问题描述(我做了什么)
    我用更新一个语句 报这个错误,

update request_keyword_task set status=0

2013 - Lost connection to MySQL server during query
时间: 51.252s

  • 关键词

根据已有的信息不好定位问题,最好提供下两个 TiDB 节点的 tidb.log 综合分析。

有一个新错误

9006 - GC life time is shorter than transaction duration, transaction starts at 2019-10-31 10:02:50.337 +0800 CST, GC safe point is 2019-10-31 10:06:46.237 +0800 CST

有大事务的操作吗?如果有的话可以把 GC life time 的时间调长,操作完成之后再调整回来。

就是在做update操作

我调整了 下面几个 不知道哪个是对的啊

SET @@global.autocommit=0

set @@session.tidb_batch_insert=1;

set @@session.tidb_dml_batch_size=500000

又报 [ERR] 1105 - current transaction is aborted, commands ignored until end of transaction block:[kv:11]transaction too large, len:300001

这个错误 到底怎么弄啊

我不想要事务,我们这个不是交易金融数据 不用事务

目前对于update操作还不支持batch参数控制的方式,建议使用limit语句进行限制

insert 呢 我现在insert 一条一条插入的 还是出现这个问题

[ERR] 1105 - current transaction is aborted, commands ignored until end of transaction block:[kv:11]transaction too large, len:300001

insert 可以通过batch参数控制,具体可以参考链接

https://www.jianshu.com/p/e80c7f383c73

设置 成1 也不好使 set @@session.tidb_batch_insert=1; 1105 - current transaction is aborted, commands ignored until end of transaction block:[kv:11]transaction too large, len:300001

tidb_dml_batch_size参数可以设置的小一点试试,tidb_batch_insert设置为1之后,tidb会根据tidb_dml_batch_size参数切分事务

依然没有效果

有回复下的么

这个表的表结构能发下吗,表上有多少个索引

CREATE TABLE FactSalesRecord ( ID bigint(20) NOT NULL, OriginalID bigint(20) DEFAULT ‘0’, DateNum int(11) DEFAULT ‘0’, Date datetime DEFAULT NULL, Area varchar(10) DEFAULT ‘’, StoreCode varchar(10) DEFAULT ‘’, CashierCode varchar(10) DEFAULT ‘’, StreamCode varchar(10) DEFAULT ‘’, MembershipID bigint(20) DEFAULT ‘0’, Gender int(11) DEFAULT ‘0’, Age int(11) DEFAULT ‘0’, DepartmentCode int(11) DEFAULT ‘0’, DepartmentName varchar(10) DEFAULT ‘’, SegmentCode int(11) DEFAULT ‘0’, SegmentName varchar(25) DEFAULT ‘’, CategoryCode int(11) DEFAULT ‘0’, CategoryName varchar(25) DEFAULT ‘’, SubCategoryCode int(11) DEFAULT ‘0’, SubCategoryName varchar(25) DEFAULT ‘’, ProductCode int(11) DEFAULT ‘0’, ProductBarCode bigint(20) DEFAULT ‘0’, ProductBrand varchar(255) DEFAULT ‘’, ProductName varchar(255) DEFAULT ‘’, PackageType varchar(25) DEFAULT ‘’, ProductOrigin varchar(25) DEFAULT ‘’, ProductProperties int(11) DEFAULT ‘0’, Unit varchar(25) DEFAULT ‘’, NumUnitPurchased int(11) DEFAULT ‘0’, UnitPrice double DEFAULT ‘0’, SalesAmount double DEFAULT ‘0’, AgeGroup varchar(50) DEFAULT ‘’, WeekdayNum int(11) DEFAULT ‘0’, WeekdayName varchar(25) DEFAULT ‘’, OrderNum bigint(20) DEFAULT ‘0’, IfMember int(11) DEFAULT ‘0’, PurchaseSequence int(11) DEFAULT ‘0’, Month int(11) DEFAULT ‘0’, Season int(11) DEFAULT ‘0’, PromotionPrice double DEFAULT ‘0’, Discount double DEFAULT ‘0’, PaymentAmount double DEFAULT ‘0’, SegmentGroup varchar(10) DEFAULT ‘’, PRIMARY KEY (ID), KEY IDX_AUTOFIELD (ID) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_bin;

我昨天导入的时候还正常呢

http://47.103.83.176:8080/group1/zip/logs.zip

日志文件