Skip balance when colocate group is balancing (#548)
This commit is contained in:
@ -4066,6 +4066,8 @@ public class Catalog {
|
||||
tabletMeta.getOldSchemaHash());
|
||||
tablet.addReplica(replica);
|
||||
}
|
||||
|
||||
Preconditions.checkState(chosenBackendIds.size() == replicationNum, chosenBackendIds.size() + " vs. "+ replicationNum);
|
||||
}
|
||||
} else {
|
||||
throw new DdlException("Unknown distribution type: " + distributionInfoType);
|
||||
@ -4078,7 +4080,6 @@ public class Catalog {
|
||||
if (chosenBackendIds == null) {
|
||||
throw new DdlException("Failed to find enough host in all backends. need: " + replicationNum);
|
||||
}
|
||||
Preconditions.checkState(chosenBackendIds.size() == replicationNum);
|
||||
return chosenBackendIds;
|
||||
}
|
||||
|
||||
|
||||
@ -17,7 +17,7 @@
|
||||
|
||||
package org.apache.doris.clone;
|
||||
|
||||
|
||||
import com.google.common.base.Preconditions;
|
||||
import org.apache.doris.catalog.Catalog;
|
||||
import org.apache.doris.catalog.ColocateTableIndex;
|
||||
import org.apache.doris.catalog.Database;
|
||||
@ -198,6 +198,11 @@ public class ColocateTableBalancer extends Daemon {
|
||||
|
||||
Set<Long> allGroupIds = colocateIndex.getAllGroupIds();
|
||||
for (Long groupId : allGroupIds) {
|
||||
if (colocateIndex.isGroupBalancing(groupId)) {
|
||||
LOG.info("colocate group {} is balancing", groupId);
|
||||
continue;
|
||||
}
|
||||
|
||||
Database db = catalog.getDb(colocateIndex.getDB(groupId));
|
||||
List<Long> clusterAliveBackendIds = getAliveClusterBackendIds(db.getClusterName());
|
||||
Set<Long> allGroupBackendIds = colocateIndex.getBackendsByGroup(groupId);
|
||||
@ -590,6 +595,8 @@ public class ColocateTableBalancer extends Daemon {
|
||||
backends.add(cloneReplicaBackendId);
|
||||
}
|
||||
|
||||
Preconditions.checkState(replicateNum == backends.size(), replicateNum + " vs. " + backends.size());
|
||||
|
||||
AddMigrationJob(tabletInfo, cloneReplicaBackendId);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user