From 8b4f6e0111fd0dc57eb1555f2a8f2816005c4eed Mon Sep 17 00:00:00 2001 From: Simon Willnauer Date: Thu, 12 Mar 2015 12:08:26 -0700 Subject: [PATCH] [SHARD] make assert less strict to ensure local node is not null --- src/main/java/org/elasticsearch/index/shard/IndexShard.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/org/elasticsearch/index/shard/IndexShard.java b/src/main/java/org/elasticsearch/index/shard/IndexShard.java index 3b7a039cb00..996a0798203 100644 --- a/src/main/java/org/elasticsearch/index/shard/IndexShard.java +++ b/src/main/java/org/elasticsearch/index/shard/IndexShard.java @@ -222,7 +222,7 @@ public class IndexShard extends AbstractIndexShardComponent { this.codecService = codecService; this.shardSuggestService = shardSuggestService; this.shardBitsetFilterCache = shardBitsetFilterCache; - assert clusterService.lifecycleState() == Lifecycle.State.STARTED : "expected lifecycle to be started but was: " + clusterService.lifecycleState() ; // otherwise localNode is still none; + assert clusterService.localNode() != null : "Local node is null lifecycle state is: " + clusterService.lifecycleState(); this.localNode = clusterService.localNode(); state = IndexShardState.CREATED; this.refreshInterval = indexSettings.getAsTime(INDEX_REFRESH_INTERVAL, EngineConfig.DEFAULT_REFRESH_INTERVAL);