[improve](alter-job) Add a config for forbiding doing alter job (#23294)

This commit is contained in:
Lightman
2023-08-22 16:28:36 +08:00
committed by GitHub
parent 4a690f8b13
commit a4e041ea55
2 changed files with 6 additions and 0 deletions

View File

@ -2111,4 +2111,7 @@ public class Config extends ConfigBase {
"是否用 mysql 的 bigint 类型来返回 Doris 的 largeint 类型",
"Whether to use mysql's bigint type to return Doris's largeint type"})
public static boolean use_mysql_bigint_for_largeint = false;
@ConfField
public static boolean forbid_running_alter_job = false;
}

View File

@ -1602,6 +1602,9 @@ public class SchemaChangeHandler extends AlterHandler {
}
private void runAlterJobV2() {
if (Config.forbid_running_alter_job) {
return;
}
runnableSchemaChangeJobV2.values().forEach(alterJobsV2 -> {
if (!alterJobsV2.isDone() && !activeSchemaChangeJobsV2.containsKey(alterJobsV2.getJobId())
&& activeSchemaChangeJobsV2.size() < MAX_ACTIVE_SCHEMA_CHANGE_JOB_V2_SIZE) {