Skip to content

Commit 7556105

Browse files
committed
Simplified the expected gc ranges.
1 parent 1e4e433 commit 7556105

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

pkg/ddl/sanity_check.go

Lines changed: 2 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -46,14 +46,7 @@ func (e *executor) checkDeleteRangeCnt(job *model.Job) {
4646
panic(err)
4747
}
4848
if actualCnt != expectedCnt {
49-
switch job.Type {
50-
case model.ActionReorganizePartition, model.ActionRemovePartitioning, model.ActionAlterTablePartitioning:
51-
if actualCnt < expectedCnt {
52-
panic(fmt.Sprintf("expect delete range count %d, actual count %d for job type '%s'", expectedCnt, actualCnt, job.Type.String()))
53-
}
54-
default:
55-
panic(fmt.Sprintf("expect delete range count %d, actual count %d for job type '%s'", expectedCnt, actualCnt, job.Type.String()))
56-
}
49+
panic(fmt.Sprintf("expect delete range count %d, actual count %d for job type '%s'", expectedCnt, actualCnt, job.Type.String()))
5750
}
5851
}
5952

@@ -117,7 +110,7 @@ func expectedDeleteRangeCnt(ctx delRangeCntCtx, job *model.Job) (int, error) {
117110
if err != nil {
118111
return 0, errors.Trace(err)
119112
}
120-
return len(args.OldPhysicalTblIDs), nil
113+
return len(args.OldPhysicalTblIDs) + len(args.OldGlobalIndexes), nil
121114
case model.ActionAddIndex, model.ActionAddPrimaryKey:
122115
args, err := model.GetFinishedModifyIndexArgs(job)
123116
if err != nil {

0 commit comments

Comments
 (0)