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

A small number of TiFlash replica cannot be created #5401

Closed
CabinfeverB opened this issue Aug 5, 2022 · 2 comments · Fixed by #5458
Closed

A small number of TiFlash replica cannot be created #5401

CabinfeverB opened this issue Aug 5, 2022 · 2 comments · Fixed by #5458

Comments

@CabinfeverB
Copy link
Member

Bug Report

What did you do?

Enable shuffle-region-scheduler
create some new tables and create TiFlash replica for these tables.

What did you expect to see?

All table's TiFlash replicas will be AVAILABLE normally.

What did you see instead?

A TiFlash replica is UNAVAILABLE.
image
And found region info
image

What version of PD are you using (pd-server -V)?

v6.2.0-alpha-146-g99e38eb7

@CabinfeverB CabinfeverB added the type/bug The issue is confirmed as a bug. label Aug 5, 2022
@CabinfeverB
Copy link
Member Author

I found the root cause of this problem. When the region is in the joint state due to executing operator such as move-peer, at this time, if the placement rule is created and the key range of the rule is smaller than that of the region, The Joint Checker fails to match the rule during building Opearator, while the Split Checker skips the region because it is in joint state, resulting in a deadlock like situation.

@CabinfeverB
Copy link
Member Author

following code return > 0 when region doesn't cross multi range , otherwise return -1:

func (l List) GetData(start, end []byte) (index int, data []interface{}) {
i := sort.Search(len(l.segments), func(i int) bool {
return bytes.Compare(l.segments[i].startKey, start) > 0
})
if i == 0 || i != len(l.segments) && (len(end) == 0 || bytes.Compare(end, l.segments[i].startKey) > 0) {
return -1, nil
}
return i - 1, l.segments[i-1].data
}

ti-chi-bot pushed a commit that referenced this issue Aug 31, 2022
close #5401

Signed-off-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
ti-chi-bot pushed a commit to ti-chi-bot/pd that referenced this issue Aug 31, 2022
close tikv#5401

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
@nolouch nolouch removed the type/bug The issue is confirmed as a bug. label Sep 5, 2022
@ti-chi-bot ti-chi-bot added the needs-type Indicates an issue requires a type label. label Sep 5, 2022
@nolouch nolouch added the type/bug The issue is confirmed as a bug. label Sep 5, 2022
@ti-chi-bot ti-chi-bot removed the needs-type Indicates an issue requires a type label. label Sep 5, 2022
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: nolouch <nolouch@gmail.com>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: nolouch <nolouch@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
ti-chi-bot added a commit that referenced this issue Sep 27, 2022
close #5401, ref #5458

Signed-off-by: ti-chi-bot <ti-community-prow-bot@tidb.io>
Signed-off-by: HunDunDM <hundundm@gmail.com>

Co-authored-by: 混沌DM <hundundm@gmail.com>
Co-authored-by: HunDunDM <hundundm@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants