Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Scatter region should check success status #46001

Closed
rleungx opened this issue Aug 11, 2023 · 2 comments
Closed

Scatter region should check success status #46001

rleungx opened this issue Aug 11, 2023 · 2 comments
Labels
affects-7.5 component/br This issue is related to BR of TiDB. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/major type/bug The issue is confirmed as a bug.

Comments

@rleungx
Copy link
Member

rleungx commented Aug 11, 2023

Bug Report

For BR or using the tidb_scatter_region variable, we need to check the success status of the scatter operator. When we create a table, if the region is just splitted, the size might be the original region's size/n, which could not be less than 1. So PD will regard those regions as non-empty regions. Then they might be filtered by store limit.
But BR and client-go will think the scatter region succeeds since they are not in running status but cancel status.

https://github.com/tikv/tikv/blob/9dc7450ef22abde48e14e61fc16d4f22b137d450/components/raftstore/src/store/fsm/peer.rs#L4030-L4031

BR:

ok := string(resp.GetDesc()) != "scatter-region" || resp.GetStatus() != pdpb.OperatorStatus_RUNNING

client-go:
https://github.com/tikv/client-go/blob/8a214402da13d5bdc1ffb1d2726bdbb47f9beb74/tikv/split_region.go#L287
https://github.com/tikv/client-go/blob/8a214402da13d5bdc1ffb1d2726bdbb47f9beb74/tikv/split_region.go#L325

The lightning has already been fixed through #33625.

@mittalrishabh
Copy link
Contributor

I opened a PR tikv/pd#6953

@seiya-annie seiya-annie added component/br This issue is related to BR of TiDB. severity/moderate labels Aug 15, 2023
@rleungx
Copy link
Member Author

rleungx commented Aug 15, 2023

Also related to tikv/tikv#15326

@ti-chi-bot ti-chi-bot bot added may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 labels Aug 16, 2023
@Leavrth Leavrth closed this as completed Feb 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
affects-7.5 component/br This issue is related to BR of TiDB. may-affects-5.2 This bug maybe affects 5.2.x versions. may-affects-5.3 This bug maybe affects 5.3.x versions. may-affects-5.4 This bug maybe affects 5.4.x versions. may-affects-6.1 may-affects-6.5 may-affects-7.1 severity/major type/bug The issue is confirmed as a bug.
Projects
None yet
Development

No branches or pull requests

5 participants