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

Async Executor Service Depedencies Refactor #2488

Merged
merged 1 commit into from
Feb 2, 2024

Conversation

vamsi-amazon
Copy link
Member

@vamsi-amazon vamsi-amazon commented Jan 29, 2024

Description

  • Restructured the instantiation of AsyncQueryExecutorService using the Guice framework.

  • Substituted the usage of EMRServerlessClient with EMRServerlessClientFactory. This modification helps prevent unnecessary errors and warnings during the plugin bootstrapping phase, particularly when constructing EMRServerlessClient using SparkExecutionEngineConfig.

  • Previously, updating the Spark execution engine cluster configuration necessitated a system restart. With the current implementation, the recreation of EMRServerlessClient upon any cluster setting update eliminates the need for a restart.

  • statement count and session count metrics are blocking operations as they make calls to opensearch index. So, we are moving stats operations to thread pool instead of processing on Transport thread.

Issues Resolved

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.

Copy link

codecov bot commented Jan 30, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (e59bf75) 95.41% compared to head (7e91509) 95.43%.

Additional details and impacted files
@@             Coverage Diff              @@
##               main    #2488      +/-   ##
============================================
+ Coverage     95.41%   95.43%   +0.01%     
- Complexity     5006     5024      +18     
============================================
  Files           481      483       +2     
  Lines         13963    13989      +26     
  Branches        940      943       +3     
============================================
+ Hits          13323    13350      +27     
+ Misses          618      617       -1     
  Partials         22       22              
Flag Coverage Δ
sql-engine 95.43% <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.

@vamsi-amazon vamsi-amazon added backport 2.x bug Something isn't working labels Feb 1, 2024
@vamsi-amazon vamsi-amazon self-assigned this Feb 1, 2024
validateSparkExecutionEngineConfig(sparkExecutionEngineConfig);
if (isNewClientCreationRequired(sparkExecutionEngineConfig.getRegion())) {
region = sparkExecutionEngineConfig.getRegion();
this.emrServerlessClient = createEMRServerlessClient(this.region);
Copy link
Collaborator

Choose a reason for hiding this comment

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

If client changed, how to get job status of in previous region?
do we need to shutdown underlying EMRClient?

Copy link
Member Author

Choose a reason for hiding this comment

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

usecase I am targeting is customer initially didn't configure spark execution engine cluster setting(or configured wrong region) and once the customer configures we create a new client. Also, Lazy client creation when async api is first invoked.

If customer changes region in between, then it will result in errors for old jobs. Customer needs to be careful enough.[Do you see this as issue?]

Copy link
Collaborator

Choose a reason for hiding this comment

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

understood, could we add notes in our doc to alert customer?

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok.

Copy link
Member Author

Choose a reason for hiding this comment

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

Addressing in this PR: #2493

Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
@vamsi-amazon vamsi-amazon merged commit 94bd664 into opensearch-project:main Feb 2, 2024
19 of 22 checks passed
opensearch-trigger-bot bot pushed a commit that referenced this pull request Feb 2, 2024
…2488)

Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
(cherry picked from commit 94bd664)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
vamsi-amazon pushed a commit that referenced this pull request Feb 2, 2024
…2488) (#2497)

(cherry picked from commit 94bd664)

Signed-off-by: Vamsi Manohar <reddyvam@amazon.com>
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 bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants