-
Notifications
You must be signed in to change notification settings - Fork 25k
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
Fix gradle run on Serverless #105938
Conversation
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.
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; |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
There was a problem hiding this 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
Line 35 in 6ace408
settings.put("cluster.deprecation_indexing.enabled", "false"); |
There was a problem hiding this 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
There was a problem hiding this 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.
@breskeby |
I confirmed with @breskeby it is safe to merge. |
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.