diff --git a/core/src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java b/core/src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java index dc7849812f1..db46cc502f9 100644 --- a/core/src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java +++ b/core/src/main/java/org/elasticsearch/cluster/metadata/IndexMetaData.java @@ -1218,7 +1218,7 @@ public class IndexMetaData implements Diffable, ToXContent { * {@link #isIndexUsingShadowReplicas(org.elasticsearch.common.settings.Settings)}. */ public static boolean isOnSharedFilesystem(Settings settings) { - // don't use the settings directly, not to trigger manny deprecation + // don't use the settings directly, not to trigger manny deprecation logging return settings.getAsBoolean(SETTING_SHARED_FILESYSTEM, isIndexUsingShadowReplicas(settings)); } @@ -1228,7 +1228,7 @@ public class IndexMetaData implements Diffable, ToXContent { * setting for this is false. */ public static boolean isIndexUsingShadowReplicas(Settings settings) { - // don't use the settings directly, not to trigger manny deprecation + // don't use the settings directly, not to trigger manny deprecation logging return settings.getAsBoolean(SETTING_SHADOW_REPLICAS, false); } diff --git a/core/src/main/java/org/elasticsearch/gateway/PrimaryShardAllocator.java b/core/src/main/java/org/elasticsearch/gateway/PrimaryShardAllocator.java index 45292d43c8e..bb2cc475464 100644 --- a/core/src/main/java/org/elasticsearch/gateway/PrimaryShardAllocator.java +++ b/core/src/main/java/org/elasticsearch/gateway/PrimaryShardAllocator.java @@ -476,8 +476,10 @@ public abstract class PrimaryShardAllocator extends BaseGatewayShardAllocator { * recovered on any node */ private boolean recoverOnAnyNode(IndexMetaData metaData) { + // don't use the settings directly, not to trigger manny deprecation logging return (IndexMetaData.isOnSharedFilesystem(metaData.getSettings()) || IndexMetaData.isOnSharedFilesystem(this.settings)) - && IndexMetaData.INDEX_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE_SETTING.get(metaData.getSettings(), this.settings); + && (metaData.getSettings().getAsBoolean(IndexMetaData.SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false) || + this.settings.getAsBoolean(IndexMetaData.SETTING_SHARED_FS_ALLOW_RECOVERY_ON_ANY_NODE, false)); } protected abstract FetchResult fetchData(ShardRouting shard, RoutingAllocation allocation);