[Chore](Job)It is forbidden to change the status of internal JOB through PAUSE/RESUME (#29036)

This commit is contained in:
Calvin Kirs
2023-12-28 15:40:16 +08:00
committed by GitHub
parent 5171a77f9e
commit ba7b7c1f60
2 changed files with 8 additions and 2 deletions

View File

@ -58,6 +58,8 @@ public class AlterJobStatusStmt extends DdlStmt {
throw new AnalysisException("Value can't is null");
}
this.jobName = inputValue;
if (CreateJobStmt.isInnerJob(jobName)) {
throw new AnalysisException("Can't alter inner job status");
}
}
}

View File

@ -85,7 +85,7 @@ public class CreateJobStmt extends DdlStmt {
private JobExecuteType executeType;
// exclude job name prefix, which is used by inner job
private final String excludeJobNamePrefix = "inner_";
private static final String excludeJobNamePrefix = "inner_";
private static final ImmutableSet<Class<? extends DdlStmt>> supportStmtSuperClass
= new ImmutableSet.Builder<Class<? extends DdlStmt>>().add(InsertStmt.class)
@ -208,4 +208,8 @@ public class CreateJobStmt extends DdlStmt {
}
return executeSql;
}
protected static boolean isInnerJob(String jobName) {
return jobName.startsWith(excludeJobNamePrefix);
}
}