Skip to content

Commit eb54352

Browse files
committed
Deprecation logs indexing is enabled by default
Changing the default for deprecation log indexing to be true. This commit also overrides this defualt to tests where a deprecation data stream would intefere - because it uses index template, it would not be possible to delete with _index_template/*. The overrides should be removed when elastic#78850 is done. closes elastic#76292
1 parent a763a86 commit eb54352

File tree

14 files changed

+19
-11
lines changed

14 files changed

+19
-11
lines changed

client/rest-high-level/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,7 @@ testClusters.configureEach {
114114

115115
setting 'indices.lifecycle.poll_interval', '1000ms'
116116
setting 'indices.lifecycle.history_index_enabled', 'false'
117+
setting 'cluster.deprecation_indexing.enabled', 'false'
117118
keystore 'xpack.security.transport.ssl.truststore.secure_password', 'testnode'
118119
extraConfigFile 'roles.yml', file('roles.yml')
119120
user username: clusterUserNameProvider.get(),

docs/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ testClusters.matching { it.name == "integTest"}.configureEach {
6767
systemProperty 'es.geoip_v2_feature_flag_enabled', 'true'
6868
keystorePassword 'keystore-password'
6969
}
70-
70+
setting 'cluster.deprecation_indexing.enabled', 'false'
7171
// enable regexes in painless so our tests don't complain about example snippets that use them
7272
setting 'script.painless.regex.enabled', 'true'
7373
setting 'xpack.security.enabled', 'false'

x-pack/docs/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ testClusters.matching { it.name == "integTest" }.configureEach {
3939
setting 'xpack.monitoring.exporters._local.enabled', 'false'
4040
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
4141
setting 'indices.lifecycle.history_index_enabled', 'false'
42+
setting 'cluster.deprecation_indexing.enabled', 'false'
4243
setting 'xpack.license.self_generated.type', 'trial'
4344
setting 'xpack.security.authc.realms.file.file.order', '0'
4445
setting 'xpack.security.authc.realms.native.native.order', '1'

x-pack/plugin/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ testClusters.configureEach {
193193
setting 'xpack.license.self_generated.type', 'trial'
194194
// disable ILM history, since it disturbs tests using _all
195195
setting 'indices.lifecycle.history_index_enabled', 'false'
196+
setting 'cluster.deprecation_indexing.enabled', 'false'
196197
keystore 'bootstrap.password', 'x-pack-test-password'
197198
keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode'
198199
setting 'xpack.searchable.snapshot.shared_cache.size', '10mb'

x-pack/plugin/data-streams/qa/multi-node/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ testClusters.matching { it.name == "javaRestTest" }.configureEach {
2020
setting 'xpack.license.self_generated.type', 'trial'
2121
//disabling ILM history as it disturbs testDSXpackUsage test
2222
setting 'indices.lifecycle.history_index_enabled', 'false'
23+
setting 'cluster.deprecation_indexing.enabled', 'false'
2324
}
2425

2526
if (BuildParams.inFipsJvm){

x-pack/plugin/data-streams/qa/rest/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ testClusters.configureEach {
2020
setting 'xpack.license.self_generated.type', 'trial'
2121
// disable ILM history, since it disturbs tests using _all
2222
setting 'indices.lifecycle.history_index_enabled', 'false'
23+
setting 'cluster.deprecation_indexing.enabled', 'false'
2324
setting 'xpack.security.enabled', 'false'
2425
if (BuildParams.isSnapshotBuild() == false) {
2526
systemProperty 'es.index_mode_feature_flag_registered', 'true'

x-pack/plugin/deprecation/qa/rest/src/javaRestTest/java/org/elasticsearch/xpack/deprecation/DeprecationHttpIT.java

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,15 @@ public class DeprecationHttpIT extends ESRestTestCase {
6767

6868
@Before
6969
public void assertIndexingIsEnabled() throws Exception {
70-
configureWriteDeprecationLogsToIndex(true);
7170

7271
// make sure the deprecation logs indexing is enabled
7372
Response response = client().performRequest(new Request("GET", "/_cluster/settings?include_defaults=true&flat_settings=true"));
7473
assertOK(response);
7574
ObjectMapper mapper = new ObjectMapper();
7675
final JsonNode jsonNode = mapper.readTree(response.getEntity().getContent());
7776

78-
final boolean transientValue = jsonNode.at("/transient/cluster.deprecation_indexing.enabled").asBoolean();
79-
assertTrue(transientValue);
77+
final boolean defaultValue = jsonNode.at("/defaults/cluster.deprecation_indexing.enabled").asBoolean();
78+
assertTrue(defaultValue);
8079

8180
// assert index does not exist, which will prevent previous tests to interfere
8281
assertBusy(() -> {
@@ -350,8 +349,6 @@ public void testDeprecationRouteThrottling() throws Exception {
350349
}
351350

352351
public void testDisableDeprecationLogIndexing() throws Exception {
353-
354-
configureWriteDeprecationLogsToIndex(true);
355352
final Request deprecatedRequest = deprecatedRequest("GET", "xOpaqueId-testDisableDeprecationLogIndexing");
356353
assertOK(client().performRequest(deprecatedRequest));
357354
configureWriteDeprecationLogsToIndex(false);

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ public class Deprecation extends Plugin implements ActionPlugin {
4848

4949
public static final Setting<Boolean> WRITE_DEPRECATION_LOGS_TO_INDEX = Setting.boolSetting(
5050
"cluster.deprecation_indexing.enabled",
51-
false,
51+
true,
5252
Setting.Property.NodeScope,
5353
Setting.Property.Dynamic
5454
);
@@ -98,12 +98,12 @@ public Collection<Object> createComponents(
9898

9999
final RateLimitingFilter rateLimitingFilterForIndexing = new RateLimitingFilter();
100100
// enable on start.
101-
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.getDefault(environment.settings()));
101+
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.get(environment.settings()));
102102

103103
final DeprecationIndexingComponent component = new DeprecationIndexingComponent(client,
104104
environment.settings(),
105105
rateLimitingFilterForIndexing,
106-
WRITE_DEPRECATION_LOGS_TO_INDEX.getDefault(environment.settings()) //pass the default on startup
106+
WRITE_DEPRECATION_LOGS_TO_INDEX.get(environment.settings()) //pass the default on startup
107107
);
108108

109109
clusterService.getClusterSettings().addSettingsUpdateConsumer(USE_X_OPAQUE_ID_IN_FILTERING,

x-pack/plugin/ml/qa/basic-multi-node/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ testClusters.configureEach {
1111
setting 'xpack.ml.enabled', 'true'
1212
setting 'xpack.license.self_generated.type', 'trial'
1313
setting 'indices.lifecycle.history_index_enabled', 'false'
14+
setting 'cluster.deprecation_indexing.enabled', 'false'
1415
setting 'slm.history_index_enabled', 'false'
1516
}
1617

x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@ testClusters.configureEach {
5252
setting 'xpack.license.self_generated.type', 'trial'
5353
setting 'xpack.ml.min_disk_space_off_heap', '200mb'
5454
setting 'indices.lifecycle.history_index_enabled', 'false'
55+
setting 'cluster.deprecation_indexing.enabled', 'false'
5556
setting 'slm.history_index_enabled', 'false'
5657
setting 'stack.templates.enabled', 'false'
5758
// To spice things up a bit, one of the nodes is not an ML node

x-pack/plugin/monitoring/src/internalClusterTest/java/org/elasticsearch/xpack/monitoring/exporter/http/HttpExporterIT.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
110110
.put(MonitoringService.INTERVAL.getKey(), MonitoringService.MIN_INTERVAL)
111111
// we do this by default in core, but for monitoring this isn't needed and only adds noise.
112112
.put("indices.lifecycle.history_index_enabled", false)
113-
.put("index.store.mock.check_index_on_close", false);
113+
.put("index.store.mock.check_index_on_close", false)
114+
.put("cluster.deprecation_indexing.enabled", false);
114115
return builder.build();
115116
}
116117

x-pack/plugin/monitoring/src/test/java/org/elasticsearch/xpack/monitoring/test/MonitoringIntegTestCase.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
5454
// .put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false)
5555
// we do this by default in core, but for monitoring this isn't needed and only adds noise.
5656
.put("indices.lifecycle.history_index_enabled", false)
57-
.put("index.store.mock.check_index_on_close", false);
57+
.put("index.store.mock.check_index_on_close", false)
58+
.put("cluster.deprecation_indexing.enabled", false);
5859

5960
return builder.build();
6061
}

x-pack/plugin/watcher/src/internalClusterTest/java/org/elasticsearch/xpack/watcher/test/AbstractWatcherIntegrationTestCase.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
121121
.put("xpack.watcher.execution.scroll.size", randomIntBetween(1, 100))
122122
.put("xpack.watcher.watch.scroll.size", randomIntBetween(1, 100))
123123
.put("indices.lifecycle.history_index_enabled", false)
124+
.put("cluster.deprecation_indexing.enabled", false)
124125
.build();
125126
}
126127

x-pack/qa/core-rest-tests-with-security/build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ testClusters.matching { it.name == "integTest" }.configureEach {
3030
setting 'xpack.ml.enabled', 'false'
3131
setting 'xpack.license.self_generated.type', 'trial'
3232
setting 'indices.lifecycle.history_index_enabled', 'false'
33+
setting 'cluster.deprecation_indexing.enabled', 'false'
3334
setting 'xpack.security.autoconfiguration.enabled', 'false'
3435
if (BuildParams.isSnapshotBuild() == false) {
3536
systemProperty 'es.index_mode_feature_flag_registered', 'true'

0 commit comments

Comments
 (0)