Skip to content
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

[BugFix] reset the start time before execution (backport #55433) #55467

Merged
merged 1 commit into from
Jan 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ public interface AnalyzeStatus {

LocalDateTime getEndTime();

void setStartTime(LocalDateTime endTime);

void setEndTime(LocalDateTime endTime);

void setStatus(StatsConstants.ScheduleStatus status);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,11 @@ public LocalDateTime getEndTime() {
return endTime;
}

@Override
public void setStartTime(LocalDateTime startTime) {
this.startTime = startTime;
}

@Override
public void setEndTime(LocalDateTime endTime) {
this.endTime = endTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,11 @@ public LocalDateTime getEndTime() {
return endTime;
}

@Override
public void setStartTime(LocalDateTime startTime) {
this.startTime = startTime;
}

@Override
public void setEndTime(LocalDateTime endTime) {
this.endTime = endTime;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ private void execute() {
future = GlobalStateMgr.getCurrentState().getAnalyzeMgr().getAnalyzeTaskThreadPool()
.submit(() -> {
isRunning.set(true);
// reset the start time after pending, so [end-start] can represent execution period
analyzeStatus.setStartTime(LocalDateTime.now());
StatisticExecutor statisticExecutor = new StatisticExecutor();
ConnectContext statsConnectCtx = StatisticUtils.buildConnectContext();
// set session id for temporary table
Expand Down
Loading