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

Throw exception for RECOVER INDEX JOB query #2988

Merged
merged 1 commit into from
Sep 9, 2024

Conversation

ykmr1224
Copy link
Collaborator

@ykmr1224 ykmr1224 commented Sep 5, 2024

Description

  • Throw exception for RECOVER INDEX JOB query
  • RECOVER INDEX JOB query is intended to be executed directly to spark to recover aborted streaming job, and does not expect execution from SQL plugin/async-query-core.

Related Issues

n/a

Check List

  • New functionality includes testing.
  • New functionality has been documented.
  • New functionality has javadoc added.
  • New functionality has a user manual doc added.
  • API changes companion pull request created.
  • Commits are signed per the DCO using --signoff.
  • Public documentation issue/PR created.

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.

Copy link
Collaborator

@noCharger noCharger left a comment

Choose a reason for hiding this comment

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

LGTM but please double check with @dai-chen if there's any concern on disable this path

@@ -119,6 +119,9 @@ private AsyncQueryHandler getQueryHandlerForFlintExtensionQuery(
} else if (IndexQueryActionType.REFRESH.equals(indexQueryDetails.getIndexQueryActionType())) {
// Manual refresh should be handled by batch handler
return queryHandlerFactory.getRefreshQueryHandler(dispatchQueryRequest.getAccountId());
} else if (IndexQueryActionType.RECOVER.equals(indexQueryDetails.getIndexQueryActionType())) {
// RECOVER INDEX JOB should not be executed from async-query-core
throw new IllegalArgumentException("RECOVER INDEX JOB is not allowed.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

throw unsupported operation exception?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

I checked other codes and IllegalArgumentException tend to be used when user specified something unsupported in the parameters. And UnsupportedOperationException tend to be used for when the operation (like create, delete, etc.) itself is not supported. I see mixed cases, though...

@ykmr1224 ykmr1224 merged commit 2c878fb into opensearch-project:main Sep 9, 2024
15 of 16 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Sep 9, 2024
Signed-off-by: Tomoyuki Morita <[email protected]>
(cherry picked from commit 2c878fb)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
ykmr1224 pushed a commit that referenced this pull request Sep 9, 2024
(cherry picked from commit 2c878fb)

Signed-off-by: Tomoyuki Morita <[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 maintenance Improves code quality, but not the product
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants