[BugFix]Disable tablet creation optimization when partitions has multiple indexes (backport #62595) (#62600)

Signed-off-by: sevev <qiangzh95@gmail.com>
Co-authored-by: zhangqiang <qiangzh95@gmail.com>
This commit is contained in:
mergify[bot] 2025-09-01 22:18:03 +08:00 committed by GitHub
parent ff3e3b86bd
commit 678a880fe3
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 5 additions and 0 deletions

View File

@ -215,6 +215,11 @@ public class TabletTaskExecutor {
CreateTabletOption option)
throws DdlException {
ArrayList<CreateReplicaTask> tasks = new ArrayList<>((int) physicalPartition.storageReplicaCount());
// TabletCreationOptimization must ensure that the schemas of all tablets under a partition are consistent.
// If multiple indexes exist in the partition, disable TabletCreationOptimization.
if (physicalPartition.getMaterializedIndices(MaterializedIndex.IndexExtState.VISIBLE).size() > 1) {
option.setEnableTabletCreationOptimization(false);
}
for (MaterializedIndex index : physicalPartition.getMaterializedIndices(MaterializedIndex.IndexExtState.VISIBLE)) {
tasks.addAll(buildCreateReplicaTasks(dbId, table, physicalPartition, index, computeResource, option));
}