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

[FEATURE] Refactor plugins.query.executionengine.spark.config #2511

Open
noCharger opened this issue Feb 6, 2024 · 0 comments
Open

[FEATURE] Refactor plugins.query.executionengine.spark.config #2511

noCharger opened this issue Feb 6, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@noCharger
Copy link
Collaborator

Is your feature request related to a problem?

If user config the cluster setting incorrectly, the Async Query APIs are disabled.

PUT _cluster/settings
{
  "persistent": {
    "plugins.query.executionengine.spark.config": "{}"
  }
}

[2024-02-06T21:06:16,954][ERROR][o.o.s.s.r.RestAsyncQueryManagementAction] [node-1] Error happened during request handling
java.lang.IllegalArgumentException: Async Query APIs are disabled. Please configure plugins.query.executionengine.spark.config in cluster settings to enable them.
        at org.opensearch.sql.spark.client.EMRServerlessClientFactoryImpl.validateSparkExecutionEngineConfig(EMRServerlessClientFactoryImpl.java:52) ~[spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.spark.client.EMRServerlessClientFactoryImpl.getClient(EMRServerlessClientFactoryImpl.java:36) ~[spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.spark.dispatcher.SparkQueryDispatcher.dispatch(SparkQueryDispatcher.java:61) ~[spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.spark.asyncquery.AsyncQueryExecutorServiceImpl.createAsyncQuery(AsyncQueryExecutorServiceImpl.java:43) ~[spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.spark.transport.TransportCreateAsyncQueryRequestAction.doExecute(TransportCreateAsyncQueryRequestAction.java:51) [spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.spark.transport.TransportCreateAsyncQueryRequestAction.doExecute(TransportCreateAsyncQueryRequestAction.java:25) [spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:218) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.indexmanagement.rollup.actionfilter.FieldCapsFilter.apply(FieldCapsFilter.kt:118) [opensearch-index-management-2.12.0.0.jar:2.12.0.0]
        at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.indexmanagement.controlcenter.notification.filter.IndexOperationActionFilter.apply(IndexOperationActionFilter.kt:39) [opensearch-index-management-2.12.0.0.jar:2.12.0.0]
        at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.security.filter.SecurityFilter.apply0(SecurityFilter.java:395) [opensearch-security-2.12.0.0.jar:2.12.0.0]
        at org.opensearch.security.filter.SecurityFilter.apply(SecurityFilter.java:165) [opensearch-security-2.12.0.0.jar:2.12.0.0]
        at org.opensearch.action.support.TransportAction$RequestFilterChain.proceed(TransportAction.java:216) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.action.support.TransportAction.execute(TransportAction.java:188) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.action.support.TransportAction.execute(TransportAction.java:107) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.client.node.NodeClient.executeLocally(NodeClient.java:110) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.client.node.NodeClient.doExecute(NodeClient.java:97) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.client.support.AbstractClient.execute(AbstractClient.java:476) [opensearch-2.12.0.jar:2.12.0]
        at org.opensearch.sql.spark.rest.RestAsyncQueryManagementAction.lambda$executePostRequest$1(RestAsyncQueryManagementAction.java:126) [spark-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.sql.datasources.utils.Scheduler.lambda$withCurrentContext$0(Scheduler.java:30) [datasources-2.12.0.0-SNAPSHOT.jar:?]
        at org.opensearch.common.util.concurrent.ThreadContext$ContextPreservingRunnable.run(ThreadContext.java:854) [opensearch-2.12.0.jar:2.12.0]
        at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144) [?:?]
        at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642) [?:?]
        at java.base/java.lang.Thread.run(Thread.java:1583) [?:?]
[2024-02-06T21:09:22,689][INFO ][o.o.j.s.JobSweeper       ] [node-1] Running full sweep

What solution would you like?

Instead of doing validation while reading the configuration. Is it possible to block the empty bracket and perform the validation beforehand?

@noCharger noCharger added enhancement New feature or request untriaged labels Feb 6, 2024
@Swiddis Swiddis removed the untriaged label Mar 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants