Deprecation logs indexing is enabled by default. Backport(#78991) #79035
Deprecation logs indexing is enabled by default. Backport(#78991) #79035pgomulka merged 13 commits intoelastic:7.xfrom
Conversation
Changing the default for deprecation log indexing to be true. This commit also overrides this default to tests where a deprecation data stream would interfere - 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
…tion_indexing_by_default
…tion_indexing_by_default
|
@elasticmachine run elasticsearch-ci/part-1 |
| commonNodeConfig(node, null, null); | ||
| // We need to translate these settings there as there's no support to do per version config for testclusters yet | ||
|
|
||
| if (node.getTestDistribution().equals(TestDistribution.DEFAULT)) { |
There was a problem hiding this comment.
interestingly I did not have to do this in master - I did not see mixed-cluster rolling-upgrade test failures.
Without this change - the rolling-upgrade were failing because when node upgraded to v7.16 the setting was set in the upgraded node config.
but it should be? it is being set in comonNodeConfig..
There was a problem hiding this comment.
I thought you made this changed in #79226 as well though?
There was a problem hiding this comment.
yes - but the #79226 is just a follow up. I added it there as a precaution - I have not seen this failing in master yet
| Installation installation = Installation.ofArchive(sh, distribution, fullInstallPath); | ||
| ServerUtils.disableGeoIpDownloader(installation); | ||
|
|
||
| if (Platforms.WINDOWS) { |
There was a problem hiding this comment.
this is really worrying, but I gave up for now.
the Windows was resulting with error
Unexpected exit code (expected 0, got 1) for script: C:\tmp\elasticsearch\bin\elasticsearch-service.bat stop
I am pretty sure that it emitted deprecation warnings (security licence related), but why would it fail the stop script?
https://gradle-enterprise.elastic.co/s/ccdeyjv34nm6m/tests/:qa:os:destructiveDistroTest.default-windows-archive/org.elasticsearch.packaging.test.WindowsServiceTests/test33JavaChanged
this test is always failing when deprecation log indexing is enabled
There was a problem hiding this comment.
Looking at Bootstrap, we have extra handling for stopping gracefully on Windows, which involves the Node explicitly closing all components and plugins. This could result in something logging a deprecation warning while the node was in the middle of shutting down, which then causes the bulk processor to explode, and take out the node, causing a non-zero exit code.
We could amend DeprecationIndexingComponent#doStop to also cancel the bulk processor. BulkProcessordoesn't have acancel()method at the moment, but we could add one. It would be likeclose(or more accuratelyawaitClose()`), except it wouldn't flush any pending actions.
What do you think?
There was a problem hiding this comment.
I think this is a good idea, we definitely need some more hardening around shutdown, data stream deletion
this test specifically failed with this in logs
[2021-10-14T10:59:33,612][ERROR][o.e.x.d.l.DeprecationIndexingComponent] [ELASTICSEARCH-C] Bulk write of deprecation logs encountered some failures: [[gS91fnwBfMC4zzZUEPlp NodeClosedException[node closed {ELASTICSEARCH-C}{wjutwiy2RCKty_vlySBv9g}{RJuxwdfbQrqSFK9-27Tzzw}{127.0.0.1}{127.0.0.1:9300}{cdfhilmrstw}{ml.machine_memory=103075397632, xpack.installed=true, transform.node=true, ml.max_open_jobs=512, ml.max_jvm_size=1073741824}]]]
but I have seen errors when a data stream was deleted (together with indices but a bulk processor still attempted to index documents.
There was a problem hiding this comment.
Can you create a followup issue to track this down/improve it?
| "settings": { | ||
| "index": { | ||
| "hidden" : true, | ||
| "auto_expand_replicas" : "0-1", |
There was a problem hiding this comment.
also interesting I did not have to set this on master. In 7.x I got some failures complaining about not able to allocate replica in testing
There was a problem hiding this comment.
yes but https://github.com/elastic/elasticsearch/pull/79226/files is against master
this PR is a backport and it would fail in CI without this change. Somehow master CI was able to pass
| 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); |
There was a problem hiding this comment.
Isn't the default value of this setting always true now? i.e. this assertion isn't useful any more?
There was a problem hiding this comment.
there is a possibility that a test in another class (there is ML test in this module) executes first and pollutes the cluster (overrides this setting)
|
|
||
| @After | ||
| public void resetFeatures() throws IOException { | ||
| Response response = adminClient().performRequest(new Request("POST", "/_features/_reset")); |
There was a problem hiding this comment.
Why do we need this now?
| Installation installation = Installation.ofArchive(sh, distribution, fullInstallPath); | ||
| ServerUtils.disableGeoIpDownloader(installation); | ||
|
|
||
| if (Platforms.WINDOWS) { |
There was a problem hiding this comment.
Can you create a followup issue to track this down/improve it?
Changing the default for deprecation log indexing to be true.
This commit also overrides this default to tests where a deprecation
data stream would interfere - because it uses index template, it would
not be possible to delete with _index_template/*.
The overrides should be removed when #78850 is done.
closes #76292
backport #78991