From: Simon Brandhof Date: Fri, 1 Sep 2017 07:46:22 +0000 (+0200) Subject: SONAR-9712 app node can index when ES is yellow X-Git-Tag: 6.6-RC1~449 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6aa52b1c97f10271f537f25c0014ea52edcab3f4;p=sonarqube.git SONAR-9712 app node can index when ES is yellow No need to wait for green. --- diff --git a/server/sonar-server/src/main/java/org/sonar/server/es/IndexerStartupTask.java b/server/sonar-server/src/main/java/org/sonar/server/es/IndexerStartupTask.java index cabbe77ea37..b10d21808fa 100644 --- a/server/sonar-server/src/main/java/org/sonar/server/es/IndexerStartupTask.java +++ b/server/sonar-server/src/main/java/org/sonar/server/es/IndexerStartupTask.java @@ -77,13 +77,13 @@ public class IndexerStartupTask { private void setInitialized(IndexType indexType) { String index = indexType.getIndex(); - waitForIndexGreen(index); + waitForIndexYellow(index); metadataIndex.setInitialized(indexType, true); } - private void waitForIndexGreen(String index) { + private void waitForIndexYellow(String index) { Client nativeClient = esClient.nativeClient(); - ClusterHealthAction.INSTANCE.newRequestBuilder(nativeClient).setIndices(index).setWaitForGreenStatus().get(TimeValue.timeValueMinutes(10)); + ClusterHealthAction.INSTANCE.newRequestBuilder(nativeClient).setIndices(index).setWaitForYellowStatus().get(TimeValue.timeValueMinutes(10)); } private String getLogMessage(Set emptyTypes, String suffix) {