Skip to content

Commit

Permalink
[BugFix] Fix show proc replications (backport #50878) (#51103)
Browse files Browse the repository at this point in the history
Co-authored-by: xiangguangyxg <[email protected]>
  • Loading branch information
mergify[bot] and xiangguangyxg authored Sep 18, 2024
1 parent eb585e2 commit 79331df
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public ProcResult fetchResult() throws AnalysisException {
row.add(TimeUtils.longToTimeString(job.getCreatedTimeMs()));
row.add(TimeUtils.longToTimeString(job.getFinishedTimeMs()));
row.add(job.getState().toString());
row.add(job.getRunningTaskNum() + "/" + job.getTotalTaskNum());
row.add(job.getState().isRunning() ? (job.getRunningTaskNum() + "/" + job.getTotalTaskNum()) : "");
row.add(Strings.nullToEmpty(job.getErrorMessage()));
result.addRow(row);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ public String name() {
return "UNKNOWN";
}

public boolean isRunning() {
return id == SNAPSHOTING.id || id == REPLICATING.id;
}

public static final ReplicationJobState INITIALIZING = new ReplicationJobState(1);
public static final ReplicationJobState SNAPSHOTING = new ReplicationJobState(2);
public static final ReplicationJobState REPLICATING = new ReplicationJobState(3);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public class ShowProcStmt extends ShowStmt {
.add("routine_loads")
.add("transactions")
.add("compactions")
.add("replications")
.build();
}

Expand Down

0 comments on commit 79331df

Please sign in to comment.