]> source.dussan.org Git - sonarqube.git/commitdiff
SONAR-9712 app node can index when ES is yellow
authorSimon Brandhof <simon.brandhof@sonarsource.com>
Fri, 1 Sep 2017 07:46:22 +0000 (09:46 +0200)
committerSimon Brandhof <simon.brandhof@sonarsource.com>
Tue, 5 Sep 2017 12:24:13 +0000 (14:24 +0200)
No need to wait for green.

server/sonar-server/src/main/java/org/sonar/server/es/IndexerStartupTask.java

index cabbe77ea37441b3db22153e3efe2641f476125b..b10d21808faf2fd42fbc69fa299c64068237784e 100644 (file)
@@ -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<IndexType> emptyTypes, String suffix) {