You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
create table if not exists sbtest2 (
id int(11) not null primary key,
k int(11) not null,
c char(120) not null default '',
pad char(255) not null default '',
index i_k(k))`
Prepare some date:
create table if not exists sbtest1 (
id int(11) not null primary key,
k int(11) not null,
c char(120) not null default '',
pad char(255) not null default )
load data local infile 'data.txt' into sbtest1;
Then execute insert into sbtest2 select * from sbtest1
During the 2PC(two phase commit) prewriting, there are a lot of mutations on the index regions.
Because the k range is small, nearly all the write workload comes to a single region, and that region becomes a hotspot.
What follows on is the region split and TiDB get a great amount of RegionMiss, and also the ServerIsBusy error.
All the kv related metrics become abnormal as they can't locate the correct region:
TiKV is overload when the writing workload is on a single region
A related problem is the concurrency rate limit here #15794, a higher concurrency rate makes the situration worse.
Development Task
During 2PC, if we detect a lot of mutations on a single region that region would become a hotspot. Maybe we can pre-split the region to avoid TiKV server is busy error.
This issue is found in the large transaction test case.
https://github.com/pingcap/tidb-test/pull/1021/files#diff-424b95097a5cbed11ebaebcc55adea53R24
Prepare a table:
Prepare some date:
The load data is created here https://github.com/pingcap/tidb-test/pull/1021/files#diff-720b9eda508e29a7e8e7f6f7725bd8e9R23
about 30000000 records and the value range for
k
is small (random 0~512)Then execute
insert into sbtest2 select * from sbtest1
During the 2PC(two phase commit) prewriting, there are a lot of mutations on the index regions.
Because the
k
range is small, nearly all the write workload comes to a single region, and that region becomes a hotspot.What follows on is the region split and TiDB get a great amount of RegionMiss, and also the ServerIsBusy error.
All the kv related metrics become abnormal as they can't locate the correct region:
TiKV is overload when the writing workload is on a single region
A related problem is the concurrency rate limit here #15794, a higher concurrency rate makes the situration worse.
Development Task
During 2PC, if we detect a lot of mutations on a single region that region would become a hotspot. Maybe we can pre-split the region to avoid TiKV server is busy error.
The 2PC prewrite code here
tidb/store/tikv/2pc.go
Line 606 in a0c7407
Some code related to split table region
tidb/ddl/split_region.go
Line 37 in a0c7407
The text was updated successfully, but these errors were encountered: