diff --git a/docs/reference/migration/migrate_7_9.asciidoc b/docs/reference/migration/migrate_7_9.asciidoc index 1e4866092b5..c58b1b10a76 100644 --- a/docs/reference/migration/migrate_7_9.asciidoc +++ b/docs/reference/migration/migrate_7_9.asciidoc @@ -10,6 +10,7 @@ your application to {es} 7.9. See also <> and <>. * <> +* <> //NOTE: The notable-breaking-changes tagged regions are re-used in the //Installation and Upgrade Guide @@ -67,5 +68,30 @@ setting. You may use `script.context.$CONTEXT.max_compilations_rate` for the par context. For example, for the `processor_conditional` context, use `script.context.processor_conditional.max_compilations_rate`. +==== + +[discrete] +[[breaking_79_settings_changes]] +=== Settings changes + +[[deprecate_auto_import_dangling_indices]] +.Automatically importing dangling indices is disabled by default. + +[%collapsible] +==== +*Details* + +Automatically importing <> into the cluster +is unsafe and is now disabled by default. This feature will be removed entirely +in {es} 8.0.0. + +*Impact* + +Use the <> to list, delete or import +any dangling indices manually. + +Alternatively you can enable automatic imports of dangling indices, recovering +the unsafe behaviour of earlier versions, by setting +`gateway.auto_import_dangling_indices` to `true`. This setting is deprecated +and will be removed in {es} 8.0.0. We do not recommend using this setting. + ==== //end::notable-breaking-changes[] diff --git a/docs/reference/release-notes/7.9.asciidoc b/docs/reference/release-notes/7.9.asciidoc index d29cd748f8a..85f03b1a70c 100644 --- a/docs/reference/release-notes/7.9.asciidoc +++ b/docs/reference/release-notes/7.9.asciidoc @@ -31,3 +31,9 @@ Thread pool write queue size:: `indexing_pressure.memory.limit` setting. This setting configures a limit to the number of bytes allowed to be consumed by outstanding indexing requests. {es-issue}59263[#59263] + +Dangling indices:: +* Automatically importing dangling indices is now deprecated, disabled by + default, and will be removed in {es} 8.0. See the + <>. + {es-pull}58176[#58176] {es-pull}58898[#58898] (issue: {es-issue}48366[#48366]) diff --git a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java index 0010ddd825e..a5dd5a92fc2 100644 --- a/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java +++ b/server/src/internalClusterTest/java/org/elasticsearch/cluster/coordination/UnsafeBootstrapAndDetachCommandIT.java @@ -42,6 +42,7 @@ import java.util.List; import java.util.Locale; import static org.elasticsearch.action.support.WriteRequest.RefreshPolicy.IMMEDIATE; +import static org.elasticsearch.gateway.DanglingIndicesState.AUTO_IMPORT_DANGLING_INDICES_SETTING; import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery; import static org.elasticsearch.indices.recovery.RecoverySettings.INDICES_RECOVERY_MAX_BYTES_PER_SEC_SETTING; import static org.elasticsearch.test.NodeRoles.nonMasterNode; @@ -314,11 +315,15 @@ public class UnsafeBootstrapAndDetachCommandIT extends ESIntegTestCase { public void testAllMasterEligibleNodesFailedDanglingIndexImport() throws Exception { internalCluster().setBootstrapMasterNodeIndex(0); + Settings settings = Settings.builder() + .put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true) + .build(); + logger.info("--> start mixed data and master-eligible node and bootstrap cluster"); - String masterNode = internalCluster().startNode(); // node ordinal 0 + String masterNode = internalCluster().startNode(settings); // node ordinal 0 logger.info("--> start data-only node and ensure 2 nodes stable cluster"); - String dataNode = internalCluster().startDataOnlyNode(); // node ordinal 1 + String dataNode = internalCluster().startDataOnlyNode(settings); // node ordinal 1 ensureStableCluster(2); logger.info("--> index 1 doc and ensure index is green"); @@ -332,11 +337,18 @@ public class UnsafeBootstrapAndDetachCommandIT extends ESIntegTestCase { assertThat(client().prepareGet("test", "type1", "1").execute().actionGet().isExists(), equalTo(true)); logger.info("--> stop data-only node and detach it from the old cluster"); - Settings dataNodeDataPathSettings = internalCluster().dataPathSettings(dataNode); + Settings dataNodeDataPathSettings = Settings.builder() + .put(internalCluster().dataPathSettings(dataNode), true) + .put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true) + .build(); assertBusy(() -> internalCluster().getInstance(GatewayMetaState.class, dataNode).allPendingAsyncStatesWritten()); internalCluster().stopRandomNode(InternalTestCluster.nameFilter(dataNode)); final Environment environment = TestEnvironment.newEnvironment( - Settings.builder().put(internalCluster().getDefaultSettings()).put(dataNodeDataPathSettings).build()); + Settings.builder() + .put(internalCluster().getDefaultSettings()) + .put(dataNodeDataPathSettings) + .put(AUTO_IMPORT_DANGLING_INDICES_SETTING.getKey(), true) + .build()); detachCluster(environment, false); logger.info("--> stop master-eligible node, clear its data and start it again - new cluster should form"); diff --git a/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java b/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java index 49698acb4ef..8c6e5ba5ccd 100644 --- a/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java +++ b/server/src/main/java/org/elasticsearch/gateway/DanglingIndicesState.java @@ -64,7 +64,7 @@ public class DanglingIndicesState implements ClusterStateListener { */ public static final Setting AUTO_IMPORT_DANGLING_INDICES_SETTING = Setting.boolSetting( "gateway.auto_import_dangling_indices", - true, + false, Setting.Property.NodeScope, Setting.Property.Deprecated );