Fix failing internal cluster tests.
Signed-off-by: Rabi Panda <adnapibar@gmail.com>
This commit is contained in:
parent
d7f2b09bae
commit
34ab4defbe
|
@ -204,6 +204,13 @@ public class ClusterApplierService extends AbstractLifecycleComponent implements
|
|||
return clusterState;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if the appliedClusterState is not null
|
||||
*/
|
||||
public boolean isInitialClusterStateSet() {
|
||||
return Objects.nonNull(this.state.get());
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a high priority applier of updated cluster states.
|
||||
*/
|
||||
|
|
|
@ -80,7 +80,7 @@ public final class ShardIndexingPressureSettings {
|
|||
public static boolean isShardIndexingPressureAttributeEnabled() {
|
||||
// Null check is required only for bwc tests which start node without initializing cluster service.
|
||||
// In actual run time, clusterService will never be null.
|
||||
if (Objects.nonNull(clusterService)) {
|
||||
if (Objects.nonNull(clusterService) && clusterService.getClusterApplierService().isInitialClusterStateSet()) {
|
||||
Iterator<DiscoveryNode> nodes = clusterService.state().getNodes().getNodes().valuesIt();
|
||||
while (nodes.hasNext()) {
|
||||
if (Boolean.parseBoolean(nodes.next().getAttributes().get(SHARD_INDEXING_PRESSURE_ENABLED_ATTRIBUTE_KEY)) == false) {
|
||||
|
|
Loading…
Reference in New Issue