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 cancellation framework changes in wlm #15651

Merged

Conversation

kaushalmahi12
Copy link
Contributor

Description

Includes the Resource Cancellation framework changes for Workload management.

Related Issues

Resolves #14883

Check List

  • Functionality includes testing.
  • API changes companion pull request created, if applicable.
  • Public documentation issue/PR created, if applicable.

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.

kiranprakash154 and others added 17 commits August 28, 2024 06:14
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
@jainankitk
Copy link
Collaborator

❌ Gradle check result for a6b1afd: FAILURE

Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change?

@kaushalmahi12 - It seems the failures are related to the code changes:

[Test Result](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/) (8 failures / +4)

    [org.opensearch.http.SearchRestCancellationIT.testAutomaticCancellationMultiSearchDuringFetchPhase](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.http/SearchRestCancellationIT/testAutomaticCancellationMultiSearchDuringFetchPhase/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testGetAllCancellableTasks_ReturnsTasksWhenBreachingThresholds](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testGetAllCancellableTasks_ReturnsTasksWhenBreachingThresholds/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testCancelTasks_does_not_cancelTasksFromDeletedQueryGroups_whenNodeNotInDuress](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testCancelTasks_does_not_cancelTasksFromDeletedQueryGroups_whenNodeNotInDuress/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testCancelTasks_cancelsGivenTasks_WhenNodeInDuress](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testCancelTasks_cancelsGivenTasks_WhenNodeInDuress/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testCancelTasks_cancelsGivenTasks](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testCancelTasks_cancelsGivenTasks/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testCancelTasks_cancelsTasksFromDeletedQueryGroups](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testCancelTasks_cancelsTasksFromDeletedQueryGroups/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testGetCancellableTasksFrom_setupAppropriateCancellationReasonAndScore](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testGetCancellableTasksFrom_setupAppropriateCancellationReasonAndScore/)
    [org.opensearch.wlm.cancellation.TaskCancellerTests.testGetCancellableTasksFrom_returnsTasksWhenBreachingThreshold](https://build.ci.opensearch.org/job/gradle-check/47612/testReport/junit/org.opensearch.wlm.cancellation/TaskCancellerTests/testGetCancellableTasksFrom_returnsTasksWhenBreachingThreshold/)

@kaushalmahi12
Copy link
Contributor Author

kaushalmahi12 commented Sep 9, 2024

@kaushalmahi12 - It seems the failures are related to the code changes:

Locally these were succeeding let me fix this

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Copy link
Contributor

❕ Gradle check result for 981b15f: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link

codecov bot commented Sep 10, 2024

Codecov Report

Attention: Patch coverage is 98.18182% with 2 lines in your changes missing coverage. Please review.

Project coverage is 71.82%. Comparing base (92d7fe8) to head (7bb6b2c).
Report is 3 commits behind head on main.

Files with missing lines Patch % Lines
...ancellation/QueryGroupTaskCancellationService.java 96.87% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #15651      +/-   ##
============================================
- Coverage     71.90%   71.82%   -0.09%     
- Complexity    64216    64231      +15     
============================================
  Files          5272     5277       +5     
  Lines        300597   300691      +94     
  Branches      43440    43449       +9     
============================================
- Hits         216151   215978     -173     
- Misses        66680    66983     +303     
+ Partials      17766    17730      -36     

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

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Copy link
Contributor

❕ Gradle check result for caf5914: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

Copy link
Collaborator

@jainankitk jainankitk left a comment

Choose a reason for hiding this comment

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

@kaushalmahi12 - Looks much better now, just few minor comments!

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Copy link
Contributor

✅ Gradle check result for b78ca02: SUCCESS

Signed-off-by: Ankit Jain <akjain@amazon.com>
Copy link
Contributor

❕ Gradle check result for 7bb6b2c: UNSTABLE

Please review all flaky tests that succeeded after retry and create an issue if one does not already exist to track the flaky failure.

@jainankitk jainankitk merged commit 58794ad into opensearch-project:main Sep 11, 2024
33 of 34 checks passed
@opensearch-trigger-bot
Copy link
Contributor

The backport to 2.x failed:

The process '/usr/bin/git' failed with exit code 128

To backport manually, run these commands in your terminal:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-15651-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 58794ada3d18f1103b3382a8556eadc2a2e0e94b
# Push it to GitHub
git push --set-upstream origin backport/backport-15651-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

Then, create a pull request where the base branch is 2.x and the compare/head branch is backport/backport-15651-to-2.x.

kaushalmahi12 added a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 11, 2024
* cancellation related

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update CHANGELOG.md

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* add better cancellation reason

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update DefaultTaskCancellationTests.java

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* refactor

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* refactor

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update DefaultTaskCancellation.java

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update DefaultTaskCancellation.java

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update DefaultTaskCancellation.java

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* Update DefaultTaskSelectionStrategy.java

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* refactor

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* refactor node level threshold

Signed-off-by: Kiran Prakash <awskiran@amazon.com>

* use query group task

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* code clean up and refactorings

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* add unit tests and fix existing ones

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* uncomment the test case

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* update CHANGELOG

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* fix imports

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* refactor and add UTs for new constructs

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* fix javadocs

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* remove code clutter

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* change annotation version and task selection strategy

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* rename a util class

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* remove wrappers from resource type

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* apply spotless

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* address comments

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* add rename changes

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* address comments

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* refactor changes and logical bug fix

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

* address comments

Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>

---------

Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Kiran Prakash <awskiran@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
jainankitk added a commit that referenced this pull request Sep 11, 2024
* cancellation related



* Update CHANGELOG.md



* add better cancellation reason



* Update DefaultTaskCancellationTests.java



* refactor



* refactor



* Update DefaultTaskCancellation.java



* Update DefaultTaskCancellation.java



* Update DefaultTaskCancellation.java



* Update DefaultTaskSelectionStrategy.java



* refactor



* refactor node level threshold



* use query group task



* code clean up and refactorings



* add unit tests and fix existing ones



* uncomment the test case



* update CHANGELOG



* fix imports



* refactor and add UTs for new constructs



* fix javadocs



* remove code clutter



* change annotation version and task selection strategy



* rename a util class



* remove wrappers from resource type



* apply spotless



* address comments



* add rename changes



* address comments



* refactor changes and logical bug fix



* address comments



---------

Signed-off-by: Kiran Prakash <awskiran@amazon.com>
Signed-off-by: Kaushal Kumar <ravi.kaushal97@gmail.com>
Signed-off-by: Ankit Jain <akjain@amazon.com>
Co-authored-by: Kiran Prakash <awskiran@amazon.com>
Co-authored-by: Ankit Jain <akjain@amazon.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

QueryGroup Task Cancellation Framework and Implementation
4 participants