Skip to content

Commit f7bf727

Browse files
Remove much remaining frozen indices code (#120539)
This removes the transport action and the index setting. The deprecation check has to go because the setting it uses to detect frozen indices has gone. We are issueing a critical deprecation warning in 8.last telling users to unfreeze them. A lot of integration tests under `x-pack/plugin/sql` also have to go, because they rely on being able to freeze indices. ES-9736 #comment Removed the transport action and the index setting and so on in #120539
1 parent d2814d5 commit f7bf727

File tree

47 files changed

+38
-702
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+38
-702
lines changed

x-pack/plugin/core/src/main/java/module-info.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@
6666
exports org.elasticsearch.xpack.core.esql;
6767
exports org.elasticsearch.xpack.core.esql.action;
6868
exports org.elasticsearch.xpack.core.esql.action.internal; // TODO: qualify to esql when modularized
69-
exports org.elasticsearch.xpack.core.frozen.action;
7069
exports org.elasticsearch.xpack.core.frozen;
7170
exports org.elasticsearch.xpack.core.graph.action;
7271
exports org.elasticsearch.xpack.core.graph;

x-pack/plugin/core/src/main/java/org/elasticsearch/index/engine/frozen/FrozenEngine.java

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,6 @@
1717
import org.apache.lucene.store.Directory;
1818
import org.elasticsearch.common.lucene.Lucene;
1919
import org.elasticsearch.common.lucene.index.ElasticsearchDirectoryReader;
20-
import org.elasticsearch.common.settings.Setting;
2120
import org.elasticsearch.core.IOUtils;
2221
import org.elasticsearch.core.SuppressForbidden;
2322
import org.elasticsearch.index.engine.Engine;
@@ -55,12 +54,7 @@
5554
* stats in order to obtain the number of reopens.
5655
*/
5756
public final class FrozenEngine extends ReadOnlyEngine {
58-
public static final Setting<Boolean> INDEX_FROZEN = Setting.boolSetting(
59-
"index.frozen",
60-
false,
61-
Setting.Property.IndexScope,
62-
Setting.Property.PrivateIndex
63-
);
57+
6458
private final SegmentsStats segmentsStats;
6559
private final DocsStats docsStats;
6660
private volatile ElasticsearchDirectoryReader lastOpenedReader;

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/frozen/action/FreezeIndexAction.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

x-pack/plugin/deprecation/src/main/java/org/elasticsearch/xpack/deprecation/IndexDeprecationChecker.java

Lines changed: 0 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
import org.elasticsearch.index.IndexModule;
1616
import org.elasticsearch.index.IndexSettings;
1717
import org.elasticsearch.index.IndexVersion;
18-
import org.elasticsearch.index.engine.frozen.FrozenEngine;
1918
import org.elasticsearch.xpack.core.deprecation.DeprecatedIndexPredicate;
2019
import org.elasticsearch.xpack.core.deprecation.DeprecationIssue;
2120

@@ -71,7 +70,6 @@ private List<BiFunction<IndexMetadata, ClusterState, DeprecationIssue>> indexSet
7170
IndexDeprecationChecker::translogRetentionSettingCheck,
7271
IndexDeprecationChecker::checkIndexDataPath,
7372
IndexDeprecationChecker::storeTypeSettingCheck,
74-
IndexDeprecationChecker::frozenIndexSettingCheck,
7573
IndexDeprecationChecker::deprecatedCamelCasePattern,
7674
IndexDeprecationChecker::legacyRoutingSettingCheck
7775
);
@@ -189,24 +187,6 @@ private static DeprecationIssue storeTypeSettingCheck(IndexMetadata indexMetadat
189187
return null;
190188
}
191189

192-
private static DeprecationIssue frozenIndexSettingCheck(IndexMetadata indexMetadata, ClusterState clusterState) {
193-
Boolean isIndexFrozen = FrozenEngine.INDEX_FROZEN.get(indexMetadata.getSettings());
194-
if (Boolean.TRUE.equals(isIndexFrozen)) {
195-
String indexName = indexMetadata.getIndex().getName();
196-
return new DeprecationIssue(
197-
DeprecationIssue.Level.WARNING,
198-
"index ["
199-
+ indexName
200-
+ "] is a frozen index. The frozen indices feature is deprecated and will be removed in a future version",
201-
"https://www.elastic.co/guide/en/elasticsearch/reference/master/frozen-indices.html",
202-
"Frozen indices no longer offer any advantages. Consider cold or frozen tiers in place of frozen indices.",
203-
false,
204-
null
205-
);
206-
}
207-
return null;
208-
}
209-
210190
private static DeprecationIssue legacyRoutingSettingCheck(IndexMetadata indexMetadata, ClusterState clusterState) {
211191
List<String> deprecatedSettings = LegacyTiersDetection.getDeprecatedFilteredAllocationSettings(indexMetadata.getSettings());
212192
if (deprecatedSettings.isEmpty()) {

x-pack/plugin/deprecation/src/test/java/org/elasticsearch/xpack/deprecation/IndexDeprecationCheckerTests.java

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import org.elasticsearch.index.IndexMode;
2222
import org.elasticsearch.index.IndexSettings;
2323
import org.elasticsearch.index.IndexVersion;
24-
import org.elasticsearch.index.engine.frozen.FrozenEngine;
2524
import org.elasticsearch.indices.TestIndexNameExpressionResolver;
2625
import org.elasticsearch.snapshots.SearchableSnapshotsSettings;
2726
import org.elasticsearch.test.ESTestCase;
@@ -328,30 +327,6 @@ public void testSimpleFSSetting() {
328327
);
329328
}
330329

331-
public void testFrozenIndex() {
332-
Settings.Builder settings = settings(IndexVersion.current());
333-
settings.put(FrozenEngine.INDEX_FROZEN.getKey(), true);
334-
IndexMetadata indexMetadata = IndexMetadata.builder("test").settings(settings).numberOfShards(1).numberOfReplicas(0).build();
335-
ClusterState state = ClusterState.builder(ClusterState.EMPTY_STATE).metadata(Metadata.builder().put(indexMetadata, true)).build();
336-
Map<String, List<DeprecationIssue>> issuesByIndex = checker.check(
337-
state,
338-
new DeprecationInfoAction.Request(TimeValue.THIRTY_SECONDS)
339-
);
340-
assertThat(
341-
issuesByIndex.get("test"),
342-
contains(
343-
new DeprecationIssue(
344-
DeprecationIssue.Level.WARNING,
345-
"index [test] is a frozen index. The frozen indices feature is deprecated and will be removed in a future version",
346-
"https://www.elastic.co/guide/en/elasticsearch/reference/master/frozen-indices.html",
347-
"Frozen indices no longer offer any advantages. Consider cold or frozen tiers in place of frozen indices.",
348-
false,
349-
null
350-
)
351-
)
352-
);
353-
}
354-
355330
public void testCamelCaseDeprecation() {
356331
String simpleMapping = "{\n\"_doc\": {"
357332
+ "\"properties\" : {\n"

x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/FrozenIndices.java

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,30 +8,19 @@
88

99
import org.elasticsearch.action.ActionRequest;
1010
import org.elasticsearch.action.ActionResponse;
11-
import org.elasticsearch.common.settings.Setting;
12-
import org.elasticsearch.index.engine.frozen.FrozenEngine;
1311
import org.elasticsearch.plugins.ActionPlugin;
1412
import org.elasticsearch.plugins.Plugin;
1513
import org.elasticsearch.xpack.core.action.XPackUsageFeatureAction;
16-
import org.elasticsearch.xpack.core.frozen.action.FreezeIndexAction;
17-
import org.elasticsearch.xpack.frozen.action.TransportFreezeIndexAction;
1814

1915
import java.util.ArrayList;
20-
import java.util.Arrays;
2116
import java.util.List;
2217

2318
public class FrozenIndices extends Plugin implements ActionPlugin {
2419

25-
@Override
26-
public List<Setting<?>> getSettings() {
27-
return Arrays.asList(FrozenEngine.INDEX_FROZEN);
28-
}
29-
3020
@Override
3121
public List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> getActions() {
3222
List<ActionHandler<? extends ActionRequest, ? extends ActionResponse>> actions = new ArrayList<>();
3323
actions.add(new ActionHandler<>(XPackUsageFeatureAction.FROZEN_INDICES, FrozenIndicesUsageTransportAction.class));
34-
actions.add(new ActionHandler<>(FreezeIndexAction.INSTANCE, TransportFreezeIndexAction.class));
3524
return actions;
3625
}
3726
}

x-pack/plugin/frozen-indices/src/main/java/org/elasticsearch/xpack/frozen/action/TransportFreezeIndexAction.java

Lines changed: 0 additions & 233 deletions
This file was deleted.

0 commit comments

Comments
 (0)