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

[Backport 2.x] Initial commit to support a search only replica for RW separation #15535

Merged
merged 3 commits into from
Aug 30, 2024

Conversation

mch2
Copy link
Member

@mch2 mch2 commented Aug 30, 2024

Description

Manual backport of #15410 to 2.x line.
This backport resolves merge conflicts and includes one src change - the wire compatibility in ShardRouting is changed from 3_0_0 to 2_17_0. 2.x also does validation differently from main for update settings / create index, and throws IAE instead of a SettingsException, so updated test to reflect that.

Related Issues

N/A

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.

…pensearch-project#15410)

* Initial commit for search only replica.
This PR contains the following:
1. Introduce searchOnly flag on ShardRouting.
2. Added feature flag to enable/disable the feature.
3. supports both create and update APIs to toggle search replica count.
4. Changes to exclude search replicas from primary eligibility.
5. Changes to prevent replicationOperations from routing to search replicas.

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* add some missing feature flag checks

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* Pr feedback from @andrross

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* Add more unit tests for settings create and update

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* Fix broken tests from setting rename

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* Fix broken tests and add changelog entry

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* More PR feedback.

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* add missing searchOnly property to initializeTargetRelocatingShard.

Without this search replicas will become regular replicas on relocation.

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* test fixes

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

* spotless

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>

---------

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
(cherry picked from commit 1e9fdb4)
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Copy link
Contributor

❌ Gradle check result for 797443c: 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?

…umentException

Signed-off-by: Marc Handalian <marc.handalian@gmail.com>
Copy link
Contributor

✅ Gradle check result for b04079e: SUCCESS

Copy link

codecov bot commented Aug 30, 2024

Codecov Report

Attention: Patch coverage is 78.87324% with 30 lines in your changes missing coverage. Please review.

Project coverage is 71.60%. Comparing base (a2b6f8c) to head (b04079e).
Report is 2 commits behind head on 2.x.

Files with missing lines Patch % Lines
.../opensearch/cluster/routing/IndexRoutingTable.java 84.61% 2 Missing and 4 partials ⚠️
...a/org/opensearch/cluster/routing/ShardRouting.java 71.42% 3 Missing and 3 partials ⚠️
...a/org/opensearch/cluster/routing/RoutingTable.java 76.19% 2 Missing and 3 partials ⚠️
...a/org/opensearch/cluster/routing/RoutingNodes.java 0.00% 0 Missing and 4 partials ⚠️
...java/org/opensearch/cluster/metadata/Metadata.java 66.66% 1 Missing and 1 partial ⚠️
...h/cluster/metadata/MetadataCreateIndexService.java 77.77% 0 Missing and 2 partials ⚠️
...luster/metadata/MetadataUpdateSettingsService.java 91.30% 0 Missing and 2 partials ⚠️
...g/opensearch/rest/action/cat/RestShardsAction.java 33.33% 1 Missing and 1 partial ⚠️
...s/replication/SegmentReplicationTargetService.java 0.00% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##                2.x   #15535      +/-   ##
============================================
- Coverage     71.73%   71.60%   -0.13%     
+ Complexity    63721    63675      -46     
============================================
  Files          5235     5235              
  Lines        297971   298114     +143     
  Branches      43363    43407      +44     
============================================
- Hits         213741   213473     -268     
- Misses        66369    66783     +414     
+ Partials      17861    17858       -3     

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

@andrross andrross merged commit 4d8a1de into opensearch-project:2.x Aug 30, 2024
39 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants