From d7c64e9ad6f39133e4f490bd7d4bb5d30e59897e Mon Sep 17 00:00:00 2001 From: wangtaohz <103108928+wangtaohz@users.noreply.github.com> Date: Thu, 29 Jun 2023 09:45:16 +0800 Subject: [PATCH] [ARCTIC-1626] Fix the touch time of Optimizer when restarting AMS (#1627) not set touch time of optimizer to current time SuspendingDetector's delay should be optimizer touch timeout --- .../com/netease/arctic/server/DefaultOptimizingService.java | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ams/server/src/main/java/com/netease/arctic/server/DefaultOptimizingService.java b/ams/server/src/main/java/com/netease/arctic/server/DefaultOptimizingService.java index 2cd0ebf614..6fd7a78939 100644 --- a/ams/server/src/main/java/com/netease/arctic/server/DefaultOptimizingService.java +++ b/ams/server/src/main/java/com/netease/arctic/server/DefaultOptimizingService.java @@ -93,7 +93,6 @@ public RuntimeHandlerChain getTableRuntimeHandler() { public void loadOptimizingQueues(List tableRuntimeMetaList) { List optimizerGroups = getAs(ResourceMapper.class, ResourceMapper::selectResourceGroups); List optimizers = getAs(OptimizerMapper.class, OptimizerMapper::selectAll); - optimizers.forEach(optimizer -> optimizer.setTouchTime(System.currentTimeMillis())); Map> optimizersByGroup = optimizers.stream().collect(Collectors.groupingBy(OptimizerInstance::getGroupName)); Map> groupToTableRuntimes = tableRuntimeMetaList.stream() @@ -243,7 +242,9 @@ protected void initHandler(List 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"); }