[bugfix](index) Fix build index limitations (#24358)

1. skip existed index on column with different id on build index
2. allow build index for CANCELED or FINISHED state
This commit is contained in:
Kang
2023-09-14 17:53:22 +08:00
committed by GitHub
parent eaa35649bc
commit 9c6734e68e
3 changed files with 48 additions and 14 deletions

View File

@ -2898,8 +2898,8 @@ public class SchemaChangeHandler extends AlterHandler {
&& indexChangeJob.getTableId() == tableId
&& indexChangeJob.getPartitionName().equals(partitionName)
&& indexChangeJob.hasSameAlterInvertedIndex(isDrop, alterIndexes)
&& indexChangeJob.getJobState() != IndexChangeJob.JobState.CANCELLED) {
// if JobState is CANCELLED, also allow user to create job again
&& !indexChangeJob.isDone()) {
// if JobState is done (CANCELLED or FINISHED), also allow user to create job again
return true;
}
}