-
Notifications
You must be signed in to change notification settings - Fork 3.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[feat](job)Internal job cancellation immediately and the strong association with the STARTS parameter #36805
[feat](job)Internal job cancellation immediately and the strong association with the STARTS parameter #36805
Conversation
Thank you for your contribution to Apache Doris. Since 2024-03-18, the Document has been moved to doris-website. |
…iation with the STARTS parameter For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately.
082863c
to
d298cb4
Compare
run buildall |
TPC-H: Total hot run time: 40447 ms
|
TPC-DS: Total hot run time: 174849 ms
|
ClickBench: Total hot run time: 30.7 s
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
add case?
@@ -149,6 +150,8 @@ public void analyze(Analyzer analyzer) throws UserException { | |||
if (null != startsTimeStamp) { | |||
if (startsTimeStamp.equalsIgnoreCase(CURRENT_TIMESTAMP_STRING)) { | |||
jobExecutionConfiguration.setImmediate(true); | |||
//To avoid immediate re-scheduling, set the start time of the timer 100ms before the current time. | |||
timerDefinition.setStartTimeMs(System.currentTimeMillis() - 100L); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
what will happen if not set startTimemMs?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The syntax for Create Job doesn't immediately schedule the job. For a one-time schedule, setting the start time to CURRENT_TIMESTAMP achieves immediate scheduling. Therefore, we still need to set the startTime parameter; otherwise, the job query will lack a start time.
@@ -124,6 +124,10 @@ public void scheduleOneJob(T job) throws JobException { | |||
schedulerInstantJob(job, TaskType.SCHEDULED, null); | |||
} | |||
} | |||
if (job.getJobConfig().isImmediate() && JobExecuteType.ONE_TIME.equals(job.getJobConfig().getExecuteType())) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why JobExecuteType == ONE_TIME ,can not setLatestSchedulerTimeMs(System.currentTimeMillis())?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This variable is not persistent, so for a one-time, immediately scheduled task, there's no need to set it.
PR approved by anyone and no changes requested. |
run buildall |
TPC-H: Total hot run time: 40034 ms
|
TPC-DS: Total hot run time: 173127 ms
|
ClickBench: Total hot run time: 30.48 s
|
run buildall |
TPC-H: Total hot run time: 39467 ms
|
TPC-DS: Total hot run time: 173614 ms
|
ClickBench: Total hot run time: 30.55 s
|
run buildall |
TPC-H: Total hot run time: 39815 ms
|
TPC-DS: Total hot run time: 173584 ms
|
ClickBench: Total hot run time: 31.26 s
|
run external |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
PR approved by at least one committer and no changes requested. |
…iation with the STARTS parameter (#36805) ## Proposed changes For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately. <!--Describe your changes.-->
…iation with the STARTS parameter (apache#36805) ## Proposed changes For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately. <!--Describe your changes.--> (cherry picked from commit 904a6c0)
…iation with the STARTS parameter (apache#36805) ## Proposed changes For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately. <!--Describe your changes.--> (cherry picked from commit 904a6c0)
extends: #36805 Previously, if the user set immediate execution, the current time would replace the user's set start time
extends: apache#36805 Previously, if the user set immediate execution, the current time would replace the user's set start time
…iation with the STARTS parameter (#36805) (#38110) … ## Proposed changes For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately. <!--Describe your changes.--> (cherry picked from commit 904a6c0) ## Proposed changes Issue Number: close #36805 <!--Describe your changes.-->
extends: #36805 Previously, if the user set immediate execution, the current time would replace the user's set start time
Proposed changes
For internal tasks, such as MTMV, the start time may already be set, or the time may be adjusted immediately.