Skip to content

Commit

Permalink
Deprecation logs indexing is enabled by default
Browse files Browse the repository at this point in the history
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
  • Loading branch information
pgomulka committed Oct 12, 2021
1 parent a763a86 commit eb54352
Show file tree
Hide file tree
Showing 14 changed files with 19 additions and 11 deletions.
1 change: 1 addition & 0 deletions client/rest-high-level/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,7 @@ testClusters.configureEach {

setting 'indices.lifecycle.poll_interval', '1000ms'
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
keystore 'xpack.security.transport.ssl.truststore.secure_password', 'testnode'
extraConfigFile 'roles.yml', file('roles.yml')
user username: clusterUserNameProvider.get(),
Expand Down
2 changes: 1 addition & 1 deletion docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ testClusters.matching { it.name == "integTest"}.configureEach {
systemProperty 'es.geoip_v2_feature_flag_enabled', 'true'
keystorePassword 'keystore-password'
}

setting 'cluster.deprecation_indexing.enabled', 'false'
// enable regexes in painless so our tests don't complain about example snippets that use them
setting 'script.painless.regex.enabled', 'true'
setting 'xpack.security.enabled', 'false'
Expand Down
1 change: 1 addition & 0 deletions x-pack/docs/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ testClusters.matching { it.name == "integTest" }.configureEach {
setting 'xpack.monitoring.exporters._local.enabled', 'false'
// disable the ILM history for doc tests to avoid potential lingering tasks that'd cause test flakiness
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.security.authc.realms.file.file.order', '0'
setting 'xpack.security.authc.realms.native.native.order', '1'
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,7 @@ testClusters.configureEach {
setting 'xpack.license.self_generated.type', 'trial'
// disable ILM history, since it disturbs tests using _all
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
keystore 'bootstrap.password', 'x-pack-test-password'
keystore 'xpack.security.transport.ssl.secure_key_passphrase', 'testnode'
setting 'xpack.searchable.snapshot.shared_cache.size', '10mb'
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/data-streams/qa/multi-node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ testClusters.matching { it.name == "javaRestTest" }.configureEach {
setting 'xpack.license.self_generated.type', 'trial'
//disabling ILM history as it disturbs testDSXpackUsage test
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
}

if (BuildParams.inFipsJvm){
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/data-streams/qa/rest/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ testClusters.configureEach {
setting 'xpack.license.self_generated.type', 'trial'
// disable ILM history, since it disturbs tests using _all
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
setting 'xpack.security.enabled', 'false'
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.index_mode_feature_flag_registered', 'true'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -67,16 +67,15 @@ public class DeprecationHttpIT extends ESRestTestCase {

@Before
public void assertIndexingIsEnabled() throws Exception {
configureWriteDeprecationLogsToIndex(true);

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

final boolean transientValue = jsonNode.at("/transient/cluster.deprecation_indexing.enabled").asBoolean();
assertTrue(transientValue);
final boolean defaultValue = jsonNode.at("/defaults/cluster.deprecation_indexing.enabled").asBoolean();
assertTrue(defaultValue);

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

public void testDisableDeprecationLogIndexing() throws Exception {

configureWriteDeprecationLogsToIndex(true);
final Request deprecatedRequest = deprecatedRequest("GET", "xOpaqueId-testDisableDeprecationLogIndexing");
assertOK(client().performRequest(deprecatedRequest));
configureWriteDeprecationLogsToIndex(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ public class Deprecation extends Plugin implements ActionPlugin {

public static final Setting<Boolean> WRITE_DEPRECATION_LOGS_TO_INDEX = Setting.boolSetting(
"cluster.deprecation_indexing.enabled",
false,
true,
Setting.Property.NodeScope,
Setting.Property.Dynamic
);
Expand Down Expand Up @@ -98,12 +98,12 @@ public Collection<Object> createComponents(

final RateLimitingFilter rateLimitingFilterForIndexing = new RateLimitingFilter();
// enable on start.
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.getDefault(environment.settings()));
rateLimitingFilterForIndexing.setUseXOpaqueId(USE_X_OPAQUE_ID_IN_FILTERING.get(environment.settings()));

final DeprecationIndexingComponent component = new DeprecationIndexingComponent(client,
environment.settings(),
rateLimitingFilterForIndexing,
WRITE_DEPRECATION_LOGS_TO_INDEX.getDefault(environment.settings()) //pass the default on startup
WRITE_DEPRECATION_LOGS_TO_INDEX.get(environment.settings()) //pass the default on startup
);

clusterService.getClusterSettings().addSettingsUpdateConsumer(USE_X_OPAQUE_ID_IN_FILTERING,
Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/basic-multi-node/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ testClusters.configureEach {
setting 'xpack.ml.enabled', 'true'
setting 'xpack.license.self_generated.type', 'trial'
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
setting 'slm.history_index_enabled', 'false'
}

Expand Down
1 change: 1 addition & 0 deletions x-pack/plugin/ml/qa/native-multi-node-tests/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ testClusters.configureEach {
setting 'xpack.license.self_generated.type', 'trial'
setting 'xpack.ml.min_disk_space_off_heap', '200mb'
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
setting 'slm.history_index_enabled', 'false'
setting 'stack.templates.enabled', 'false'
// To spice things up a bit, one of the nodes is not an ML node
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
.put(MonitoringService.INTERVAL.getKey(), MonitoringService.MIN_INTERVAL)
// we do this by default in core, but for monitoring this isn't needed and only adds noise.
.put("indices.lifecycle.history_index_enabled", false)
.put("index.store.mock.check_index_on_close", false);
.put("index.store.mock.check_index_on_close", false)
.put("cluster.deprecation_indexing.enabled", false);
return builder.build();
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,8 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
// .put(XPackSettings.MACHINE_LEARNING_ENABLED.getKey(), false)
// we do this by default in core, but for monitoring this isn't needed and only adds noise.
.put("indices.lifecycle.history_index_enabled", false)
.put("index.store.mock.check_index_on_close", false);
.put("index.store.mock.check_index_on_close", false)
.put("cluster.deprecation_indexing.enabled", false);

return builder.build();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ protected Settings nodeSettings(int nodeOrdinal, Settings otherSettings) {
.put("xpack.watcher.execution.scroll.size", randomIntBetween(1, 100))
.put("xpack.watcher.watch.scroll.size", randomIntBetween(1, 100))
.put("indices.lifecycle.history_index_enabled", false)
.put("cluster.deprecation_indexing.enabled", false)
.build();
}

Expand Down
1 change: 1 addition & 0 deletions x-pack/qa/core-rest-tests-with-security/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ testClusters.matching { it.name == "integTest" }.configureEach {
setting 'xpack.ml.enabled', 'false'
setting 'xpack.license.self_generated.type', 'trial'
setting 'indices.lifecycle.history_index_enabled', 'false'
setting 'cluster.deprecation_indexing.enabled', 'false'
setting 'xpack.security.autoconfiguration.enabled', 'false'
if (BuildParams.isSnapshotBuild() == false) {
systemProperty 'es.index_mode_feature_flag_registered', 'true'
Expand Down

0 comments on commit eb54352

Please sign in to comment.