Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix gradle run on Serverless #105938

Merged

Conversation

tvernum
Copy link
Contributor

@tvernum tvernum commented Mar 5, 2024

On Serverless it is not possible to configure deprecation indexing (it is always off). This commit updates the behaviour of ElasticsearchCluster to no longer attempt to configure deprecation indexing on stateless nodes.

On Serverless it is not possible to configure deprecation indexing (it
is always off). This commit updates the behaviour of
`ElasticsearchCluster` to no longer attempt to configure deprecation
indexing on stateless nodes.
@tvernum tvernum added the :Delivery/Build Build or test infrastructure label Mar 5, 2024
@tvernum tvernum requested a review from pgomulka March 5, 2024 04:22
@tvernum tvernum requested a review from a team as a code owner March 5, 2024 04:22
@elasticsearchmachine elasticsearchmachine added v8.14.0 Team:Delivery Meta label for Delivery team labels Mar 5, 2024
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-delivery (Team:Delivery)

node.setting("cluster.deprecation_indexing.enabled", "false");
}
}
node.start();
}

private static boolean hasDeprecationIndexing(ElasticsearchNode node) {
return node.getVersion().onOrAfter("7.16.0") && node.getSettingKeys().contains("stateless.enabled") == false;
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll admit that this is a bit of a hack, and I'm open to other suggestions.
The constraints that I ran into are:

  • elasticsearch.serverless-run.gradle.kts configures a test cluster directly (not a spec) so it can't use a settings provider (which is how we solved this elsewhere)
  • ElasticsearchNode does not expose which modules exist, so I cannot make this dependent on the deprecation module existing
  • Serverless doesn't appear to be an exposed concept (as a distribution type, or version number, etc) in ElasticsearchNode (which is generally a good thing, but left me with very few options here).

This change allows ./gradlew run to work in serverless again, which is a good thing, and I would like to make that happen. I am, however, very happy to iterate on this in order to come up with a cleaner solution if people don't like this one.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is fine by me. I think the long term solution here is to have gradlew run use the new test clusters infrastructure rather than ElasticsearchNode since it's considerably more extensible.

@tvernum tvernum added the >test Issues or PRs that are addressing/adding tests label Mar 5, 2024
Copy link
Contributor

@breskeby breskeby left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You just made this change on the old test cluster framework that is kind of deprecated and will hopefully dissapear one day. Can you also apply that on our new junit rule based implementation too. (see

)

Copy link
Contributor

@pgomulka pgomulka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure this will work.
the cluster.deprecation_indexing.enabled should not be known. The deprecation indexing is part of :xpack:deprecation module which is excluded in serverless

we will be getting unknown settings exception if we set the cluster.deprecation_indexing.enabled =false

see the change that removed the module https://github.com/elastic/elasticsearch-serverless/pull/1460

Copy link
Contributor

@pgomulka pgomulka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok I see it now :)
this check will PREVENT the use of that setting.
looks great to me.

@pgomulka
Copy link
Contributor

pgomulka commented Mar 5, 2024

You just made this change on the old test cluster framework that is kind of deprecated and will hopefully dissapear one day. Can you also apply that on our new junit rule based implementation too. (see

[elasticsearch/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/DefaultSettingsProvider.java](https://github.com/elastic/elasticsearch/blob/6ace40823966a41f11ac89eb3ce566636ab699a9/test/test-clusters/src/main/java/org/elasticsearch/test/cluster/local/DefaultSettingsProvider.java#L35)

Line 35 in [6ace408](https://github.com/elastic/elasticsearch/commit/6ace40823966a41f11ac89eb3ce566636ab699a9)

 settings.put("cluster.deprecation_indexing.enabled", "false"); 
)

@breskeby
we don't use this in serverless, so perhaps it is safe.

@pgomulka
Copy link
Contributor

pgomulka commented Mar 5, 2024

I confirmed with @breskeby it is safe to merge.

@pgomulka pgomulka merged commit e9ff896 into elastic:main Mar 5, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
:Delivery/Build Build or test infrastructure Team:Delivery Meta label for Delivery team >test Issues or PRs that are addressing/adding tests v8.14.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants