Skip to content

Commit

Permalink
[ARCTIC-1626] Fix the touch time of Optimizer when restarting AMS (ap…
Browse files Browse the repository at this point in the history
…ache#1627)

not set touch time of optimizer to current time
SuspendingDetector's delay should be optimizer touch timeout
  • Loading branch information
wangtaohz authored Jun 29, 2023
1 parent d4c2f5d commit d7c64e9
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,6 @@ public RuntimeHandlerChain getTableRuntimeHandler() {
public void loadOptimizingQueues(List<TableRuntimeMeta> tableRuntimeMetaList) {
List<ResourceGroup> optimizerGroups = getAs(ResourceMapper.class, ResourceMapper::selectResourceGroups);
List<OptimizerInstance> optimizers = getAs(OptimizerMapper.class, OptimizerMapper::selectAll);
optimizers.forEach(optimizer -> optimizer.setTouchTime(System.currentTimeMillis()));
Map<String, List<OptimizerInstance>> optimizersByGroup =
optimizers.stream().collect(Collectors.groupingBy(OptimizerInstance::getGroupName));
Map<String, List<TableRuntimeMeta>> groupToTableRuntimes = tableRuntimeMetaList.stream()
Expand Down Expand Up @@ -243,7 +242,9 @@ protected void initHandler(List<TableRuntimeMeta> tableRuntimeMetaList) {
optimizerMonitorTimer = new Timer("OptimizerMonitor", true);
optimizerMonitorTimer.schedule(
new SuspendingDetector(),
ArcticServiceConstants.OPTIMIZER_CHECK_INTERVAL,
optimizerTouchTimeout,
ArcticServiceConstants.OPTIMIZER_CHECK_INTERVAL);
LOG.info("init SuspendingDetector for Optimizer with delay {} ms, interval {} ms", optimizerTouchTimeout,
ArcticServiceConstants.OPTIMIZER_CHECK_INTERVAL);
LOG.info("OptimizerManagementService initializing has completed");
}
Expand Down

0 comments on commit d7c64e9

Please sign in to comment.