-
Notifications
You must be signed in to change notification settings - Fork 101
restore: merge small ranges #578
restore: merge small ranges #578
Conversation
4a34de6
to
dd32d46
Compare
/release |
Signed-off-by: Neil Shen <[email protected]>
dd32d46
to
fa4d3a1
Compare
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
/rebuild |
Signed-off-by: Neil Shen <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rest LGTM
tests/br_debug_meta/run.sh
Outdated
run_sql "split table $DB.$TABLE by ('user6282602628620641459'), ('user6282603728132269670'), ('user6282604827643897881'), ('user6282610325202038936');" | ||
|
||
run_sql "CREATE TABLE $DB.$TABLE( \ | ||
YCSB_KEY varchar(64) NOT NULL, \ | ||
FIELD0 varchar(1) DEFAULT NULL, \ | ||
PRIMARY KEY (YCSB_KEY) \ | ||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_bin;" | ||
|
||
run_sql "INSERT INTO $DB.$TABLE VALUES (\"a\", \"b\");" | ||
run_sql "INSERT INTO $DB.$TABLE VALUES (\"aa\", \"b\");" | ||
table_region_sql="SELECT COUNT(*) FROM information_schema.tikv_region_status WHERE db_name = '$DB' AND table_name = '$TABLE';" | ||
for i in $(seq 10); do | ||
regioncount=$(run_sql "$table_region_sql" | awk '/COUNT/{print $2}') | ||
[ $regioncount -ge 5 ] && break | ||
sleep 3 | ||
done | ||
run_sql "$table_region_sql" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SPLIT TABLE
should be effective immediately, so no need to check region count again 🤔 (you could check the TOTAL_SPLIT_REGION
field returned by SPLIT TABLE
if you need to be absolutely sure)
btw there is also the SPLIT TABLE a BETWEEN ('aaaa') AND ('zzzz') REGIONS 5
syntax.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It does split, however, data is not distributed to multiple regions, so I think just leave the loop and let TiKV splits.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok.
Signed-off-by: Neil Shen <[email protected]>
/rebuild |
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
/run-integration-test Fails with #641
|
/run-integration-test |
2 similar comments
/run-integration-test |
/run-integration-test |
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
Co-authored-by: kennytm <[email protected]>
Signed-off-by: Neil Shen <[email protected]>
/rebuild |
LGTM |
/merge |
/run-all-tests |
Signed-off-by: ti-srebot <[email protected]>
cherry pick to release-4.0 in PR #655 |
Signed-off-by: Neil Shen <[email protected]>
/run-cherry-picker |
cherry pick to release-5.0-rc failed |
What problem does this PR solve?
Speed up restore by merging small range to reduce split and scatter.
What is changed and how it works?
Merge adjacent ranges that total_bytes is less 96MB or total_kv is less than 960000.
Check List
Tests
Side effects
Breaking backward compatibilityRelease Note