change order of check since routing entry might be null when the shard is just created
This commit is contained in:
parent
752ae6e206
commit
e7a892f6f0
|
@ -153,7 +153,7 @@ public class IndicesTTLService extends AbstractLifecycleComponent<IndicesTTLServ
|
|||
}
|
||||
if (hasTTLEnabled) {
|
||||
for (IndexShard indexShard : indexService) {
|
||||
if (indexShard.routingEntry().primary() && indexShard.state() == IndexShardState.STARTED && indexShard.routingEntry().started()) {
|
||||
if (indexShard.state() == IndexShardState.STARTED && indexShard.routingEntry().primary() && indexShard.routingEntry().started()) {
|
||||
shardsToPurge.add(indexShard);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue