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

Add setting plugins.query.executionengine.async_query.enabled #2510

Merged
merged 2 commits into from
Feb 6, 2024

Conversation

penghuo
Copy link
Collaborator

@penghuo penghuo commented Feb 6, 2024

Description

  • add new settings plugins.query.executionengine.async_query.enabled which disable submit async query to reject all coming requests.

Issues Resolved

#2507

Check List

  • New functionality includes testing.
    • All tests pass, including unit test, integration test and doctest
  • New functionality has been documented.
    • New functionality has javadoc added
    • New functionality has user manual doc added
  • Commits are signed per the DCO using --signoff

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.

Signed-off-by: Peng Huo <[email protected]>
Copy link

codecov bot commented Feb 6, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (2a3ebea) 95.41% compared to head (671ca08) 95.41%.

Additional details and impacted files
@@            Coverage Diff            @@
##               main    #2510   +/-   ##
=========================================
  Coverage     95.41%   95.41%           
- Complexity     5026     5027    +1     
=========================================
  Files           483      483           
  Lines         14005    14016   +11     
  Branches        944      944           
=========================================
+ Hits          13363    13374   +11     
  Misses          621      621           
  Partials         21       21           
Flag Coverage Δ
sql-engine 95.41% <100.00%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@noCharger
Copy link
Collaborator

noCharger commented Feb 6, 2024

@penghuo can we disable async_query by "plugins.query.executionengine.async_query": {}

@penghuo
Copy link
Collaborator Author

penghuo commented Feb 6, 2024

@penghuo can we disable async_query by "plugins.query.executionengine.async_query": {}

no.

curl --request PUT \
  --url http://localhost:9200/_cluster/settings \
  --header 'content-type: application/x-ndjson' \
  --data '{"transient":{"plugins.query.executionengine.async_query.enabled":{}}}'
* empty
{
  "error": {
    "root_cause": [
      {
        "type": "action_request_validation_exception",
        "reason": "Validation Failed: 1: no settings to update;"
      }
    ],
    "type": "action_request_validation_exception",
    "reason": "Validation Failed: 1: no settings to update;"
  },
  "status": 400
}
  • empty string
curl --request PUT \
  --url http://localhost:9200/_cluster/settings \
  --header 'content-type: application/x-ndjson' \
  --data '{"transient":{"plugins.query.executionengine.async_query.enabled":""}}'

{
  "error": {
    "root_cause": [
      {
        "type": "illegal_argument_exception",
        "reason": "Failed to parse value [] as only [true] or [false] are allowed."
      }
    ],
    "type": "illegal_argument_exception",
    "reason": "Failed to parse value [] as only [true] or [false] are allowed."
  },
  "status": 400
}

@vmmusings vmmusings added the enhancement New feature or request label Feb 6, 2024
@@ -46,6 +52,16 @@ protected void doExecute(
CreateAsyncQueryActionRequest request,
ActionListener<CreateAsyncQueryActionResponse> listener) {
try {
if (!(Boolean) pluginSettings.getSettingValue(Settings.Key.ASYNC_QUERY_ENABLED)) {
listener.onFailure(
new IllegalAccessException(
Copy link
Collaborator

Choose a reason for hiding this comment

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

IllegalAccessException seems a Java reflection related exception?

@penghuo penghuo merged commit cddffc6 into opensearch-project:main Feb 6, 2024
29 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 6, 2024
* Add setting plugins.query.executionengine.async_query.enabled

Signed-off-by: Peng Huo <[email protected]>

* fix format

Signed-off-by: Peng Huo <[email protected]>

---------

Signed-off-by: Peng Huo <[email protected]>
(cherry picked from commit cddffc6)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vmmusings pushed a commit that referenced this pull request Feb 6, 2024
…#2512)

* Add setting plugins.query.executionengine.async_query.enabled



* fix format



---------


(cherry picked from commit cddffc6)

Signed-off-by: Peng Huo <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants