Skip to content

Commit

Permalink
[Enhancement] Support dynamic modification of automated_cluster_snaps…
Browse files Browse the repository at this point in the history
…hot_interval_seconds and max_historical_automated_cluster_snapshot_jobs (backport #56165) (#56186)

Co-authored-by: xiangguangyxg <110401425+xiangguangyxg@users.noreply.github.com>
  • Loading branch information
mergify[bot] and xiangguangyxg authored Feb 24, 2025
1 parent 5ffef6f commit 4687af4
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion fe/fe-core/src/main/java/com/starrocks/common/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -3443,7 +3443,7 @@ public class Config extends ConfigBase {
@ConfField(mutable = true)
public static long automated_cluster_snapshot_interval_seconds = 600;

@ConfField(mutable = false)
@ConfField(mutable = true)
public static int max_historical_automated_cluster_snapshot_jobs = 100;

@ConfField(mutable = true)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public void run() {
}

try {
Thread.sleep(intervalMs);
Thread.sleep(getInterval());
} catch (InterruptedException e) {
LOG.error("InterruptedException: ", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,11 @@ public ClusterSnapshotCheckpointScheduler(CheckpointController feController,
this.firstRun = true;
}

@Override
public long getInterval() {
return Config.automated_cluster_snapshot_interval_seconds * 1000L;
}

@Override
protected void runAfterCatalogReady() {
if (!GlobalStateMgr.getCurrentState().getClusterSnapshotMgr().isAutomatedSnapshotOn()) {
Expand Down

0 comments on commit 4687af4

Please sign in to comment.