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 dynamic index and cluster setting for concurrent segment search #7956

Merged
merged 2 commits into from
Jun 12, 2023

Conversation

jed326
Copy link
Collaborator

@jed326 jed326 commented Jun 7, 2023

Description

Add dynamic cluster and index setting to control concurrent segment search. Index level setting overrides cluster level setting.

Related Issues

Resolves #7356

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.

@jed326 jed326 changed the base branch from main to 2.x June 7, 2023 17:39
@jed326 jed326 changed the base branch from 2.x to main June 7, 2023 17:39
@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Jun 7, 2023

Codecov Report

Merging #7956 (e61ba99) into main (28d5948) will decrease coverage by 0.56%.
The diff coverage is 91.42%.

@@             Coverage Diff              @@
##               main    #7956      +/-   ##
============================================
- Coverage     71.44%   70.88%   -0.56%     
+ Complexity    56913    56551     -362     
============================================
  Files          4715     4716       +1     
  Lines        267246   267268      +22     
  Branches      39186    39187       +1     
============================================
- Hits         190930   189466    -1464     
- Misses        60492    61824    +1332     
- Partials      15824    15978     +154     
Impacted Files Coverage Δ
.../org/opensearch/search/internal/SearchContext.java 36.36% <0.00%> (-0.85%) ⬇️
...va/org/opensearch/search/DefaultSearchContext.java 78.57% <75.00%> (-0.12%) ⬇️
...rg/opensearch/common/settings/ClusterSettings.java 92.85% <100.00%> (+0.35%) ⬆️
...pensearch/common/settings/IndexScopedSettings.java 100.00% <100.00%> (ø)
.../main/java/org/opensearch/index/IndexSettings.java 86.66% <100.00%> (+0.06%) ⬆️
.../main/java/org/opensearch/search/SearchModule.java 97.76% <100.00%> (-0.02%) ⬇️
...main/java/org/opensearch/search/SearchService.java 71.90% <100.00%> (-0.74%) ⬇️
...rch/search/query/ConcurrentQueryPhaseSearcher.java 75.00% <100.00%> (+5.30%) ⬆️
...search/search/query/QueryPhaseSearcherWrapper.java 100.00% <100.00%> (ø)

... and 462 files with indirect coverage changes

@github-actions
Copy link
Contributor

github-actions bot commented Jun 7, 2023

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testIndexDeletionDuringSnapshotCreationInQueue
      1 org.opensearch.search.backpressure.SearchBackpressureIT.testSearchTaskCancellationWithHighCpu
      1 org.opensearch.cluster.allocation.AwarenessAllocationIT.testThreeZoneOneReplicaWithForceZoneValueAndLoadAwareness

@jed326
Copy link
Collaborator Author

jed326 commented Jun 7, 2023

Tagging @sohami @reta @andrross for some help reviewing. Thanks!

Copy link
Collaborator

@sohami sohami left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks @jed326 for working on this

@github-actions
Copy link
Contributor

github-actions bot commented Jun 9, 2023

Gradle Check (Jenkins) Run Completed with:

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

@jed326
Copy link
Collaborator Author

jed326 commented Jun 10, 2023

Do we need a corresponding doc update for this issue? Seems important to note somewhere that the index setting overrides the cluster setting but not sure where that would go. Maybe could just track this as a part of opensearch-project/documentation-webstie#2662?

@reta
Copy link
Collaborator

reta commented Jun 10, 2023

Do we need a corresponding doc update for this issue?

Definitely, since we are adding new settings, those have to be documented, thanks @jed326

@reta
Copy link
Collaborator

reta commented Jun 12, 2023

@jed326 LGTM, one comment to cleanup the ConcurrentQueryPhaseSearcher but all good otherwise

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@jed326
Copy link
Collaborator Author

jed326 commented Jun 12, 2023

@reta looks like tests are passing, I think we should be good to merge now. Thanks!

@reta reta merged commit 068404e into opensearch-project:main Jun 12, 2023
@reta reta added the backport 2.x Backport to 2.x branch label Jun 12, 2023
@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:

# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/backport-2.x
# Create a new branch
git switch --create backport/backport-7956-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 068404ed1cef5e1d023816d57054aef98a7aa343
# Push it to GitHub
git push --set-upstream origin backport/backport-7956-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/backport-2.x

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

@reta
Copy link
Collaborator

reta commented Jun 12, 2023

@jed326 ah ... the auto 2.x backport failed, could you please submit the manual one? thank you

@jed326
Copy link
Collaborator Author

jed326 commented Jun 12, 2023

@reta Sure will do

jed326 added a commit to jed326/OpenSearch that referenced this pull request Jun 12, 2023
…pensearch-project#7956)

* Add dynamic index and cluster setting for concurrent segment search

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

* Use feature flagged settings map

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

---------

Signed-off-by: Jay Deng <[email protected]>
// Test that we throw an exception without the feature flag
SettingsModule module = new SettingsModule(Settings.EMPTY);
IndexScopedSettings indexScopedSettings = module.getIndexScopedSettings();
expectThrows(
Copy link
Collaborator Author

Choose a reason for hiding this comment

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

jed326 added a commit to jed326/OpenSearch that referenced this pull request Jun 13, 2023
…pensearch-project#7956)

* Add dynamic index and cluster setting for concurrent segment search

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

* Use feature flagged settings map

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

---------

Signed-off-by: Jay Deng <[email protected]>
reta pushed a commit that referenced this pull request Jun 13, 2023
…7956) (#8034)

* Add dynamic index and cluster setting for concurrent segment search



* Use feature flagged settings map



---------

Signed-off-by: Jay Deng <[email protected]>
gaiksaya pushed a commit to gaiksaya/OpenSearch that referenced this pull request Jun 26, 2023
…pensearch-project#7956) (opensearch-project#8034)

* Add dynamic index and cluster setting for concurrent segment search



* Use feature flagged settings map



---------

Signed-off-by: Jay Deng <[email protected]>
imRishN pushed a commit to imRishN/OpenSearch that referenced this pull request Jun 27, 2023
…pensearch-project#7956)

* Add dynamic index and cluster setting for concurrent segment search

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

* Use feature flagged settings map

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

---------

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: Rishab Nahata <[email protected]>
@martin-gaievski
Copy link
Member

@jed326 it seems that feature flag has not been removed for concurrent_search, does this mean that to enable it we need both, feature flag and new index/cluster setting?

@jed326
Copy link
Collaborator Author

jed326 commented Aug 30, 2023

@martin-gaievski Yes the feature flag is not removed. The cluster setting defaults to true so concurrent search should be enabled by default once the feature flag is enabled.

@jed326 jed326 deleted the cs-dynamic branch September 13, 2023 19:09
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…pensearch-project#7956)

* Add dynamic index and cluster setting for concurrent segment search

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

* Use feature flagged settings map

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

---------

Signed-off-by: Jay Deng <[email protected]>
Signed-off-by: Shivansh Arora <[email protected]>
@sohami sohami mentioned this pull request May 21, 2024
9 tasks
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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Concurrent Segment Search] Dynamically enable/disable concurrent search
4 participants