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

Concurrent Search Tasks Response Updates #7673

Merged
merged 3 commits into from
Jun 1, 2023

Conversation

jed326
Copy link
Collaborator

@jed326 jed326 commented May 22, 2023

Description

After #7502 has been merged we will start tracking the resource usage of the concurrent search threadpool. This change adds average,min,max resource usage to the tasks API response which are more meaningful in the concurrent search use case. These stats will only be shown whenever thread executions > 1.

{
          "node" : "0h_eKuenQgmRxhGGtDwsDg",
          "id" : 63,
          "type" : "direct",
          "action" : "indices:data/read/search[phase/query]",
          "description" : "shardId[[my-index-000001][0]]",
          "start_time_in_millis" : 1685467779105,
          "running_time_in_nanos" : 11345102263,
          "cancellable" : true,
          "cancelled" : false,
          "parent_task_id" : "0h_eKuenQgmRxhGGtDwsDg:62",
          "headers" : { },
          "resource_stats" : {
            "average" : {
              "cpu_time_in_nanos" : 13312500,
              "memory_in_bytes" : 1059688
            },
            "total" : {
              "cpu_time_in_nanos" : 26625000,
              "memory_in_bytes" : 2119376
            },
            "min" : {
              "cpu_time_in_nanos" : 29000,
              "memory_in_bytes" : 480
            },
            "max" : {
              "cpu_time_in_nanos" : 26596000,
              "memory_in_bytes" : 2118896
            },
            "thread_info" : {
              "thread_executions" : 2,
              "active_threads" : 2
            }
          }
        }

This is an implementation of solution 1 in the design from #7425.

Related Issues

#7425
Doc update Issue: opensearch-project/documentation-website#4206

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)

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.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@jed326 jed326 changed the title Cs tasks response Concurrent Search Tasks Response Updates May 22, 2023
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@jed326 jed326 force-pushed the cs-tasks-response branch 4 times, most recently from c400861 to 3217749 Compare May 23, 2023 20:35
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@jed326
Copy link
Collaborator Author

jed326 commented May 23, 2023

Failing test seems unrelated to my changes - https://build.ci.opensearch.org/job/gradle-check/16116/testReport/

org.opensearch.index.query.IntervalQueryBuilderTests > testToQuery FAILED
    java.lang.IllegalArgumentException: Too many disjunctions to expand
        at __randomizedtesting.SeedInfo.seed([5334F0F28503703F:A4CFF2CCF480B5D5]:0)
        at org.apache.lucene.queries.intervals.Disjunctions.pullUp(Disjunctions.java:45)
        at org.apache.lucene.queries.intervals.OrderedIntervalsSource.pullUpDisjunctions(OrderedIntervalsSource.java:91)
        at org.apache.lucene.queries.intervals.FilteredIntervalsSource.maxGaps(FilteredIntervalsSource.java:33)

@jed326 jed326 marked this pull request as ready for review May 23, 2023 22:35
CHANGELOG.md Outdated Show resolved Hide resolved
server/src/main/java/org/opensearch/tasks/Task.java Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@jed326
Copy link
Collaborator Author

jed326 commented May 31, 2023

@reta Not sure why it gave me a merge conflict on that last commit but I think we should be good to squash and merge now. It's rerunning the tests but as you can see the last change has no diff.

CHANGELOG.md Outdated Show resolved Hide resolved
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchTaskCancellationWithHighCpu

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreRefreshListenerIT.testRemoteRefreshRetryOnFailure
      1 org.opensearch.backwards.MixedClusterClientYamlTestSuiteIT.test {p0=tasks.list/10_basic/tasks_list test}

@jed326
Copy link
Collaborator Author

jed326 commented May 31, 2023

Looks like that latest test failure could be related to my change, diving into it.

@jed326
Copy link
Collaborator Author

jed326 commented May 31, 2023

There was an NPE issue in the constructor, should be fixed with the latest commit.

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@reta reta merged commit e3740f7 into opensearch-project:main Jun 1, 2023
@reta reta added the backport 2.x Backport to 2.x branch label Jun 1, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jun 1, 2023
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit e3740f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Jun 1, 2023
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit e3740f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
reta pushed a commit that referenced this pull request Jun 2, 2023
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit e3740f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <[email protected]>
reta pushed a commit that referenced this pull request Jun 2, 2023
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
(cherry picked from commit e3740f7)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <[email protected]>
austintlee pushed a commit to austintlee/OpenSearch that referenced this pull request Jun 2, 2023
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
reta pushed a commit that referenced this pull request Jun 2, 2023
* Add average,min,max and thread info to tasks response



* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java



---------


(cherry picked from commit e3740f7)

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
gaiksaya pushed a commit to gaiksaya/OpenSearch that referenced this pull request Jun 26, 2023
…pensearch-project#7856)

* Add average,min,max and thread info to tasks response



* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java



---------


(cherry picked from commit e3740f7)

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Signed-off-by: Andriy Redko <[email protected]>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
* Add average,min,max and thread info to tasks response

Signed-off-by: Jay Deng <[email protected]>

* Update server/src/main/java/org/opensearch/tasks/TaskResourceStats.java

Signed-off-by: Jay Deng <[email protected]>

---------

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport 2.x Backport to 2.x branch v2.9.0 'Issues and PRs related to version v2.9.0' v3.0.0 Issues and PRs related to version 3.0.0
Projects
None yet
4 participants