ebin1983
(ebin1983)
2019 年10 月 30 日 10:49
1
为提高效率,提问时请尽量提供详细背景信息,问题描述清晰可优先响应。以下信息点请尽量提供:
【系统版本 & 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
不懂就问
(zhouyueyue)
2019 年10 月 30 日 10:57
2
根据已有的信息不好定位问题,最好提供下两个 TiDB 节点的 tidb.log 综合分析。
不懂就问
(zhouyueyue)
2019 年10 月 31 日 02:25
4
有大事务的操作吗?如果有的话可以把 GC life time 的时间调长,操作完成之后再调整回来。
ebin1983
(ebin1983)
2019 年10 月 31 日 02:33
5
就是在做update操作
我调整了 下面几个 不知道哪个是对的啊
SET @@global.autocommit=0
set @@session.tidb_batch_insert=1;
set @@session.tidb_dml_batch_size=500000
ebin1983
(ebin1983)
2019 年10 月 31 日 03:09
6
又报 [ERR] 1105 - current transaction is aborted, commands ignored until end of transaction block:[kv:11]transaction too large, len:300001
这个错误 到底怎么弄啊
目前对于update操作还不支持batch参数控制的方式,建议使用limit语句进行限制
ebin1983
(ebin1983)
2019 年10 月 31 日 03:35
10
insert 呢 我现在insert 一条一条插入的 还是出现这个问题
ebin1983
(ebin1983)
2019 年10 月 31 日 03:37
11
[ERR] 1105 - current transaction is aborted, commands ignored until end of transaction block:[kv:11]transaction too large, len:300001
ebin1983
(ebin1983)
2019 年10 月 31 日 03:50
13
设置 成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参数切分事务
ebin1983
(ebin1983)
2019 年10 月 31 日 05:49
18
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;
ebin1983
(ebin1983)
2019 年10 月 31 日 05:55
20