diff --git a/client/pom.xml b/client/pom.xml
index 8ad2bea5ee2..9846028de82 100644
--- a/client/pom.xml
+++ b/client/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/common/pom.xml b/common/pom.xml
index c4d83b8f817..d857b60efaa 100644
--- a/common/pom.xml
+++ b/common/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/druid-services/pom.xml b/druid-services/pom.xml
index b71317d2352..c3f1d4f072f 100644
--- a/druid-services/pom.xml
+++ b/druid-services/pom.xml
@@ -24,11 +24,11 @@
druid-services
druid-services
druid-services
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/examples/pom.xml b/examples/pom.xml
index 8dfe0dca4d1..371c796871c 100644
--- a/examples/pom.xml
+++ b/examples/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/examples/rand/pom.xml b/examples/rand/pom.xml
index 4b1f8ab2a1d..9c47a184929 100644
--- a/examples/rand/pom.xml
+++ b/examples/rand/pom.xml
@@ -9,7 +9,7 @@
com.metamx
druid-examples
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/examples/twitter/pom.xml b/examples/twitter/pom.xml
index 60241675115..64f0c1c9709 100644
--- a/examples/twitter/pom.xml
+++ b/examples/twitter/pom.xml
@@ -9,7 +9,7 @@
com.metamx
druid-examples
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/index-common/pom.xml b/index-common/pom.xml
index d06dd7d561e..73a532064ab 100644
--- a/index-common/pom.xml
+++ b/index-common/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/indexer/pom.xml b/indexer/pom.xml
index 006dea455d5..5e04d491bee 100644
--- a/indexer/pom.xml
+++ b/indexer/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/merger/pom.xml b/merger/pom.xml
index 3d7d4a05f30..47fbaa0c4af 100644
--- a/merger/pom.xml
+++ b/merger/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/merger/src/main/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategy.java b/merger/src/main/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategy.java
index 3f522908960..05c2f2f0b26 100644
--- a/merger/src/main/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategy.java
+++ b/merger/src/main/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategy.java
@@ -174,9 +174,16 @@ public class SimpleResourceManagementStrategy implements ResourceManagementStrat
)
);
+ int maxPossibleNodesTerminated = zkWorkers.size() - minNumWorkers;
+ int numNodesToTerminate = Math.min(maxPossibleNodesTerminated, thoseLazyWorkers.size());
+ if (numNodesToTerminate <= 0) {
+ log.info("Found no nodes to terminate.");
+ return false;
+ }
+
AutoScalingData terminated = autoScalingStrategy.terminate(
Lists.transform(
- thoseLazyWorkers.subList(minNumWorkers, thoseLazyWorkers.size()),
+ thoseLazyWorkers.subList(0, numNodesToTerminate),
new Function()
{
@Override
diff --git a/merger/src/test/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategyTest.java b/merger/src/test/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategyTest.java
index 36b6bd41632..742525d38a7 100644
--- a/merger/src/test/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategyTest.java
+++ b/merger/src/test/java/com/metamx/druid/merger/coordinator/scaling/SimpleResourceManagementStrategyTest.java
@@ -223,9 +223,9 @@ public class SimpleResourceManagementStrategyTest
EasyMock.replay(workerSetupManager);
EasyMock.expect(autoScalingStrategy.ipToIdLookup(EasyMock.>anyObject()))
- .andReturn(Lists.newArrayList()).times(2);
+ .andReturn(Lists.newArrayList("ip")).times(2);
EasyMock.expect(autoScalingStrategy.terminate(EasyMock.>anyObject())).andReturn(
- new AutoScalingData(Lists.newArrayList("foobar"), Lists.newArrayList("foobrick"))
+ new AutoScalingData(Lists.newArrayList("ip"), Lists.newArrayList("ip"))
);
EasyMock.replay(autoScalingStrategy);
diff --git a/pom.xml b/pom.xml
index daa3e806318..35247c84dab 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
com.metamx
druid
pom
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
druid
druid
diff --git a/realtime/pom.xml b/realtime/pom.xml
index 37bc5d12c58..c17ae1d5d5d 100644
--- a/realtime/pom.xml
+++ b/realtime/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT
diff --git a/server/pom.xml b/server/pom.xml
index 45584f572ba..67dd4619867 100644
--- a/server/pom.xml
+++ b/server/pom.xml
@@ -28,7 +28,7 @@
com.metamx
druid
- 0.3.17-SNAPSHOT
+ 0.3.18-SNAPSHOT