From 02d0cb357ef2de33b8987c4892484195b2333912 Mon Sep 17 00:00:00 2001 From: "qiumingming.2018" Date: Fri, 11 Jan 2019 18:04:44 +0800 Subject: [PATCH 1/5] Curator server inventory await initialization --- .../curator/inventory/CuratorInventoryManager.java | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java b/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java index ee3ca05ea8c2..150d283b2798 100644 --- a/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java +++ b/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java @@ -38,7 +38,9 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; +import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -72,6 +74,8 @@ public class CuratorInventoryManager private volatile PathChildrenCache childrenCache; + private final CountDownLatch inventoryInitializationLatch = new CountDownLatch(1); + public CuratorInventoryManager( CuratorFramework curatorFramework, InventoryManagerConfig config, @@ -113,6 +117,11 @@ public void start() throws Exception try { childrenCache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); + + log.info("Waiting for Server Inventory Initialization..."); + while (!inventoryInitializationLatch.await(1, TimeUnit.MINUTES)) { + log.info("Still waiting for Server Inventory Initialization..."); + } } catch (Exception e) { synchronized (lock) { @@ -347,6 +356,7 @@ private void maybeDoneInitializing() // only fire if we are done initializing the parent PathChildrenCache if (containersInitialized && uninitializedInventory.isEmpty()) { doneInitializing = true; + inventoryInitializationLatch.countDown(); strategy.inventoryInitialized(); } } From 53d10392adc58b7d0739c64fb8bab2b6fa9a3c6f Mon Sep 17 00:00:00 2001 From: "qiumingming.2018" Date: Wed, 13 Feb 2019 13:44:24 +0800 Subject: [PATCH 2/5] address comments --- docs/content/configuration/index.md | 2 + .../CoordinatorSegmentWatcherConfig.java | 33 ++++++++++++++++ .../druid/client/CoordinatorServerView.java | 23 ++++++++++- .../druid/client/HttpServerInventoryView.java | 13 +------ .../inventory/CuratorInventoryManager.java | 10 ----- .../CachingCostBalancerStrategyConfig.java | 33 ++++++++++++++++ .../CachingCostBalancerStrategyFactory.java | 38 ++++++++++++++----- .../client/CoordinatorServerViewTest.java | 3 +- .../CuratorDruidCoordinatorTest.java | 3 +- .../org/apache/druid/cli/CliCoordinator.java | 11 +++++- 10 files changed, 133 insertions(+), 36 deletions(-) create mode 100644 server/src/main/java/org/apache/druid/client/CoordinatorSegmentWatcherConfig.java create mode 100644 server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java diff --git a/docs/content/configuration/index.md b/docs/content/configuration/index.md index f112b15fa59b..cd94c122b637 100644 --- a/docs/content/configuration/index.md +++ b/docs/content/configuration/index.md @@ -693,6 +693,7 @@ These coordinator static configurations can be defined in the `coordinator/runti |`druid.coordinator.kill.durationToRetain`| Do not kill segments in last `durationToRetain`, must be greater or equal to 0. Only applies and MUST be specified if kill is turned on. Note that default value is invalid.|PT-1S (-1 seconds)| |`druid.coordinator.kill.maxSegments`|Kill at most n segments per kill task submission, must be greater than 0. Only applies and MUST be specified if kill is turned on. Note that default value is invalid.|0| |`druid.coordinator.balancer.strategy`|Specify the type of balancing strategy that the coordinator should use to distribute segments among the historicals. `cachingCost` is logically equivalent to `cost` but is more CPU-efficient on large clusters and will replace `cost` in the future versions, users are invited to try it. Use `diskNormalized` to distribute segments among nodes so that the disks fill up uniformly and use `random` to randomly pick nodes to distribute segments.|`cost`| +|`druid.coordinator.balancer.cachingCost.awaitInitialization`|Whether to wait for segment view initialization before creating the `cachingCost` balancing strategy. This property is enabled only when `druid.coordinator.balancer.strategy` is `cachingCost`. If set to 'true', the Coordinator will not start to assign segments, until the segment view is initialized. If set to 'false', the Coordinator will fallback to use the `cost` balancing strategy only if the segment view is not initialized yet. Notes, it may take much time to wait for the initialization since the `cachingCost` balancing strategy involves much computing to build itself.|false| |`druid.coordinator.loadqueuepeon.repeatDelay`|The start and repeat delay for the loadqueuepeon , which manages the load and drop of segments.|PT0.050S (50 ms)| |`druid.coordinator.asOverlord.enabled`|Boolean value for whether this coordinator node should act like an overlord as well. This configuration allows users to simplify a druid cluster by not having to deploy any standalone overlord nodes. If set to true, then overlord console is available at `http://coordinator-host:port/console.html` and be sure to set `druid.coordinator.asOverlord.overlordService` also. See next.|false| |`druid.coordinator.asOverlord.overlordService`| Required, if `druid.coordinator.asOverlord.enabled` is `true`. This must be same value as `druid.service` on standalone Overlord nodes and `druid.selectors.indexing.serviceName` on Middle Managers.|NULL| @@ -702,6 +703,7 @@ These coordinator static configurations can be defined in the `coordinator/runti |--------|---------------|-----------|-------| |`druid.serverview.type`|batch or http|Segment discovery method to use. "http" enables discovering segments using HTTP instead of zookeeper.|batch| |`druid.coordinator.loadqueuepeon.type`|curator or http|Whether to use "http" or "curator" implementation to assign segment loads/drops to historical|curator| +|`druid.coordinator.segment.awaitInitializationOnStart`|true or false|Whether the the Coordinator will wait for its view of segments to fully initialize before starting up. If set to 'true', the Coordinator's HTTP server will not start up, and the Coordinator will not announce itself as available, until the server view is initialized.|true| ##### Additional config when "http" loadqueuepeon is used |Property|Description|Default| diff --git a/server/src/main/java/org/apache/druid/client/CoordinatorSegmentWatcherConfig.java b/server/src/main/java/org/apache/druid/client/CoordinatorSegmentWatcherConfig.java new file mode 100644 index 000000000000..ed51012fe18f --- /dev/null +++ b/server/src/main/java/org/apache/druid/client/CoordinatorSegmentWatcherConfig.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.client; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CoordinatorSegmentWatcherConfig +{ + @JsonProperty + private boolean awaitInitializationOnStart = true; + + public boolean isAwaitInitializationOnStart() + { + return awaitInitializationOnStart; + } +} diff --git a/server/src/main/java/org/apache/druid/client/CoordinatorServerView.java b/server/src/main/java/org/apache/druid/client/CoordinatorServerView.java index dd2198d21c2b..8b314ef4ef21 100644 --- a/server/src/main/java/org/apache/druid/client/CoordinatorServerView.java +++ b/server/src/main/java/org/apache/druid/client/CoordinatorServerView.java @@ -22,7 +22,9 @@ import com.google.common.collect.Iterables; import com.google.common.collect.Ordering; import com.google.inject.Inject; +import org.apache.druid.guice.ManageLifecycle; import org.apache.druid.java.util.common.concurrent.Execs; +import org.apache.druid.java.util.common.lifecycle.LifecycleStart; import org.apache.druid.java.util.common.logger.Logger; import org.apache.druid.query.DataSource; import org.apache.druid.server.coordination.DruidServerMetadata; @@ -33,11 +35,13 @@ import java.util.Collection; import java.util.HashMap; import java.util.Map; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; /** * ServerView of coordinator for the state of segments being loaded in the cluster. */ +@ManageLifecycle public class CoordinatorServerView implements InventoryView { private static final Logger log = new Logger(CoordinatorServerView.class); @@ -48,13 +52,18 @@ public class CoordinatorServerView implements InventoryView private final Map> timelines; private final ServerInventoryView baseView; + private final CoordinatorSegmentWatcherConfig segmentWatcherConfig; + + private final CountDownLatch initialized = new CountDownLatch(1); @Inject public CoordinatorServerView( - ServerInventoryView baseView + ServerInventoryView baseView, + CoordinatorSegmentWatcherConfig segmentWatcherConfig ) { this.baseView = baseView; + this.segmentWatcherConfig = segmentWatcherConfig; this.segmentLoadInfos = new HashMap<>(); this.timelines = new HashMap<>(); @@ -80,6 +89,7 @@ public ServerView.CallbackAction segmentRemoved(final DruidServerMetadata server @Override public ServerView.CallbackAction segmentViewInitialized() { + initialized.countDown(); return ServerView.CallbackAction.CONTINUE; } } @@ -99,6 +109,17 @@ public ServerView.CallbackAction serverRemoved(DruidServer server) ); } + @LifecycleStart + public void start() throws InterruptedException + { + if (segmentWatcherConfig.isAwaitInitializationOnStart()) { + final long startMillis = System.currentTimeMillis(); + log.info("%s waiting for initialization.", getClass().getSimpleName()); + initialized.await(); + log.info("%s initialized in [%,d] ms.", getClass().getSimpleName(), System.currentTimeMillis() - startMillis); + } + } + private void removeServer(DruidServer server) { for (DataSegment segment : server.getSegments().values()) { diff --git a/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java b/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java index bf0d1237d425..bb840a0d9302 100644 --- a/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java +++ b/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java @@ -61,7 +61,6 @@ import java.util.Map; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.Executor; import java.util.concurrent.ScheduledExecutorService; import java.util.concurrent.TimeUnit; @@ -109,8 +108,6 @@ public class HttpServerInventoryView implements ServerInventoryView, FilteredSer private final ObjectMapper smileMapper; private final HttpServerInventoryViewConfig config; - private final CountDownLatch inventoryInitializationLatch = new CountDownLatch(1); - @Inject public HttpServerInventoryView( final @Smile ObjectMapper smileMapper, @@ -130,7 +127,7 @@ public HttpServerInventoryView( @LifecycleStart - public void start() throws Exception + public void start() throws ISE { synchronized (lifecycleLock) { if (!lifecycleLock.canStart()) { @@ -195,12 +192,6 @@ private DruidServer toDruidServer(DiscoveryDruidNode node) lifecycleLock.exitStart(); } - log.info("Waiting for Server Inventory Initialization..."); - - while (!inventoryInitializationLatch.await(1, TimeUnit.MINUTES)) { - log.info("Still waiting for Server Inventory Initialization..."); - } - log.info("Started HttpServerInventoryView."); } } @@ -369,8 +360,6 @@ private void serverInventoryInitialized() } } - inventoryInitializationLatch.countDown(); - log.info("Calling SegmentCallback.segmentViewInitialized() for all callbacks."); runSegmentCallbacks( diff --git a/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java b/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java index 150d283b2798..ee3ca05ea8c2 100644 --- a/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java +++ b/server/src/main/java/org/apache/druid/curator/inventory/CuratorInventoryManager.java @@ -38,9 +38,7 @@ import java.util.Set; import java.util.concurrent.ConcurrentHashMap; import java.util.concurrent.ConcurrentMap; -import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutorService; -import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicReference; import java.util.stream.Collectors; @@ -74,8 +72,6 @@ public class CuratorInventoryManager private volatile PathChildrenCache childrenCache; - private final CountDownLatch inventoryInitializationLatch = new CountDownLatch(1); - public CuratorInventoryManager( CuratorFramework curatorFramework, InventoryManagerConfig config, @@ -117,11 +113,6 @@ public void start() throws Exception try { childrenCache.start(PathChildrenCache.StartMode.POST_INITIALIZED_EVENT); - - log.info("Waiting for Server Inventory Initialization..."); - while (!inventoryInitializationLatch.await(1, TimeUnit.MINUTES)) { - log.info("Still waiting for Server Inventory Initialization..."); - } } catch (Exception e) { synchronized (lock) { @@ -356,7 +347,6 @@ private void maybeDoneInitializing() // only fire if we are done initializing the parent PathChildrenCache if (containersInitialized && uninitializedInventory.isEmpty()) { doneInitializing = true; - inventoryInitializationLatch.countDown(); strategy.inventoryInitialized(); } } diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java new file mode 100644 index 000000000000..9ccc3be77d73 --- /dev/null +++ b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java @@ -0,0 +1,33 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +package org.apache.druid.server.coordinator; + +import com.fasterxml.jackson.annotation.JsonProperty; + +public class CachingCostBalancerStrategyConfig +{ + @JsonProperty + private boolean awaitInitialization = true; + + public boolean isAwaitInitialization() + { + return awaitInitialization; + } +} diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java index a6261db080b9..de6571ec740e 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java @@ -35,10 +35,10 @@ import java.util.concurrent.CancellationException; import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CountDownLatch; import java.util.concurrent.ExecutionException; import java.util.concurrent.ExecutorService; import java.util.concurrent.RejectedExecutionException; -import java.util.concurrent.atomic.AtomicBoolean; public class CachingCostBalancerStrategyFactory implements BalancerStrategyFactory { @@ -47,19 +47,19 @@ public class CachingCostBalancerStrategyFactory implements BalancerStrategyFacto /** Must be single-threaded, because {@link ClusterCostCache.Builder} and downstream builders are not thread-safe */ private final ExecutorService executor = Execs.singleThreaded("CachingCostBalancerStrategy-executor"); private final ClusterCostCache.Builder clusterCostCacheBuilder = ClusterCostCache.builder(); - /** - * Atomic is needed to use compareAndSet(true, true) construction below, that is linearizable with the write made from - * callback, that ensures visibility of the write made from callback. Neither plain field nor volatile field read - * ensure such visibility - */ - private final AtomicBoolean initialized = new AtomicBoolean(false); + + private final CountDownLatch initialized = new CountDownLatch(1); + private final CachingCostBalancerStrategyConfig config; @JsonCreator public CachingCostBalancerStrategyFactory( @JacksonInject ServerInventoryView serverInventoryView, - @JacksonInject Lifecycle lifecycle + @JacksonInject Lifecycle lifecycle, + @JacksonInject CachingCostBalancerStrategyConfig config ) throws Exception { + this.config = config; + // Adding to lifecycle dynamically because couldn't use @ManageLifecycle on the class, // see https://github.com/apache/incubator-druid/issues/4980 lifecycle.addMaybeStartManagedInstance(this); @@ -85,7 +85,7 @@ public ServerView.CallbackAction segmentRemoved(DruidServerMetadata server, Data @Override public ServerView.CallbackAction segmentViewInitialized() { - initialized.set(true); + initialized.countDown(); return ServerView.CallbackAction.CONTINUE; } } @@ -112,10 +112,28 @@ public void stop() executor.shutdownNow(); } + private boolean isInitialized() + { + return initialized.getCount() == 0; + } + @Override public BalancerStrategy createBalancerStrategy(final ListeningExecutorService exec) { - if (initialized.compareAndSet(true, true)) { + if (!isInitialized() && config.isAwaitInitialization()) { + try { + final long startMillis = System.currentTimeMillis(); + LOG.info("Waiting for segment view initialization before creating CachingCostBalancerStrategy."); + initialized.await(); + LOG.info("Segment view initialized in [%,d] ms.", System.currentTimeMillis() - startMillis); + } + catch (InterruptedException e) { + LOG.error("Segment view initialization has been interrupted."); + Thread.currentThread().interrupt(); + } + } + + if (isInitialized()) { try { // Calling clusterCostCacheBuilder.build() in the same thread (executor's sole thread) where // clusterCostCacheBuilder is updated, to avoid problems with concurrent updates diff --git a/server/src/test/java/org/apache/druid/client/CoordinatorServerViewTest.java b/server/src/test/java/org/apache/druid/client/CoordinatorServerViewTest.java index 619baf4b8aa0..7f7ac91febdc 100644 --- a/server/src/test/java/org/apache/druid/client/CoordinatorServerViewTest.java +++ b/server/src/test/java/org/apache/druid/client/CoordinatorServerViewTest.java @@ -330,7 +330,8 @@ public CallbackAction segmentViewInitialized() }; overlordServerView = new CoordinatorServerView( - baseView + baseView, + new CoordinatorSegmentWatcherConfig() ); baseView.start(); diff --git a/server/src/test/java/org/apache/druid/server/coordinator/CuratorDruidCoordinatorTest.java b/server/src/test/java/org/apache/druid/server/coordinator/CuratorDruidCoordinatorTest.java index 0810a02de3ba..f4ec867acb79 100644 --- a/server/src/test/java/org/apache/druid/server/coordinator/CuratorDruidCoordinatorTest.java +++ b/server/src/test/java/org/apache/druid/server/coordinator/CuratorDruidCoordinatorTest.java @@ -29,6 +29,7 @@ import org.apache.curator.framework.recipes.cache.PathChildrenCacheEvent; import org.apache.curator.utils.ZKPaths; import org.apache.druid.client.BatchServerInventoryView; +import org.apache.druid.client.CoordinatorSegmentWatcherConfig; import org.apache.druid.client.CoordinatorServerView; import org.apache.druid.client.DruidServer; import org.apache.druid.client.ImmutableDruidDataSource; @@ -471,7 +472,7 @@ public CallbackAction segmentViewInitialized() } }; - serverView = new CoordinatorServerView(baseView); + serverView = new CoordinatorServerView(baseView, new CoordinatorSegmentWatcherConfig()); baseView.start(); diff --git a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java index 7f36e0cb6065..fd87677d9030 100644 --- a/services/src/main/java/org/apache/druid/cli/CliCoordinator.java +++ b/services/src/main/java/org/apache/druid/cli/CliCoordinator.java @@ -29,6 +29,7 @@ import io.airlift.airline.Command; import org.apache.curator.framework.CuratorFramework; import org.apache.druid.audit.AuditManager; +import org.apache.druid.client.CoordinatorSegmentWatcherConfig; import org.apache.druid.client.CoordinatorServerView; import org.apache.druid.client.HttpServerInventoryViewResource; import org.apache.druid.client.coordinator.Coordinator; @@ -58,6 +59,7 @@ import org.apache.druid.metadata.MetadataStorageProvider; import org.apache.druid.server.audit.AuditManagerProvider; import org.apache.druid.server.coordinator.BalancerStrategyFactory; +import org.apache.druid.server.coordinator.CachingCostBalancerStrategyConfig; import org.apache.druid.server.coordinator.DruidCoordinator; import org.apache.druid.server.coordinator.DruidCoordinatorCleanupPendingSegments; import org.apache.druid.server.coordinator.DruidCoordinatorConfig; @@ -148,6 +150,12 @@ public void configure(Binder binder) JsonConfigProvider.bind(binder, "druid.manager.rules", MetadataRuleManagerConfig.class); JsonConfigProvider.bind(binder, "druid.manager.lookups", LookupCoordinatorManagerConfig.class); JsonConfigProvider.bind(binder, "druid.coordinator.balancer", BalancerStrategyFactory.class); + JsonConfigProvider.bind(binder, "druid.coordinator.segment", CoordinatorSegmentWatcherConfig.class); + JsonConfigProvider.bind( + binder, + "druid.coordinator.balancer.cachingCost", + CachingCostBalancerStrategyConfig.class + ); binder.bind(RedirectFilter.class).in(LazySingleton.class); if (beOverlord) { @@ -169,11 +177,12 @@ public void configure(Binder binder) .in(ManageLifecycle.class); binder.bind(IndexingServiceClient.class).to(HttpIndexingServiceClient.class).in(LazySingleton.class); - binder.bind(CoordinatorServerView.class).in(LazySingleton.class); binder.bind(LookupCoordinatorManager.class).in(LazySingleton.class); + binder.bind(CoordinatorServerView.class); binder.bind(DruidCoordinator.class); + LifecycleModule.register(binder, CoordinatorServerView.class); LifecycleModule.register(binder, MetadataStorage.class); LifecycleModule.register(binder, DruidCoordinator.class); From 34624253c8c572b90cfbd7d266736f182ad5bc7d Mon Sep 17 00:00:00 2001 From: "qiumingming.2018" Date: Thu, 14 Feb 2019 11:31:30 +0800 Subject: [PATCH 3/5] print exception object in log --- .../server/coordinator/CachingCostBalancerStrategyFactory.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java index 83babd61c55e..93df9ab738c7 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyFactory.java @@ -134,7 +134,7 @@ public BalancerStrategy createBalancerStrategy(final ListeningExecutorService ex LOG.info("Segment view initialized in [%,d] ms.", System.currentTimeMillis() - startMillis); } catch (InterruptedException e) { - LOG.error("Segment view initialization has been interrupted."); + LOG.error(e, "Segment view initialization has been interrupted."); Thread.currentThread().interrupt(); } } From 98bb14da55487dece9dfde21354e9d489cf70247 Mon Sep 17 00:00:00 2001 From: "qiumingming.2018" Date: Sun, 17 Feb 2019 11:11:57 +0800 Subject: [PATCH 4/5] remove throws ISE --- .../java/org/apache/druid/client/HttpServerInventoryView.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java b/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java index 97ed3bb952e5..1279b3af41c3 100644 --- a/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java +++ b/server/src/main/java/org/apache/druid/client/HttpServerInventoryView.java @@ -129,7 +129,7 @@ public HttpServerInventoryView( @LifecycleStart - public void start() throws ISE + public void start() { synchronized (lifecycleLock) { if (!lifecycleLock.canStart()) { From 33c864da5be386dea22dcc79efc6b70a3fc425d5 Mon Sep 17 00:00:00 2001 From: "qiumingming.2018" Date: Wed, 20 Feb 2019 11:28:02 +0800 Subject: [PATCH 5/5] cachingCost awaitInitialization default to false --- .../server/coordinator/CachingCostBalancerStrategyConfig.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java index 9ccc3be77d73..eb0a668301dd 100644 --- a/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java +++ b/server/src/main/java/org/apache/druid/server/coordinator/CachingCostBalancerStrategyConfig.java @@ -24,7 +24,7 @@ public class CachingCostBalancerStrategyConfig { @JsonProperty - private boolean awaitInitialization = true; + private boolean awaitInitialization = false; public boolean isAwaitInitialization() {