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

[Segment Replication] Handle failover in mixed cluster mode #9536

Merged
merged 5 commits into from
Aug 31, 2023

Conversation

Poojita-Raj
Copy link
Contributor

Description

This change will ensure that the replica that's on the oldest opensearch version is promoted to primary in the event of a failover in a segment replication enabled cluster. This would avoid the problem of replicas on older opensearch versions not being able to read the segments sent by newer opensearch version primaries.

Related Issues

Resolves #9027

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

Compatibility status:

Checks if related components are compatible with change c93d086

Incompatible components

Incompatible components: [https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/asynchronous-search.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/cross-cluster-replication.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@codecov
Copy link

codecov bot commented Aug 24, 2023

Codecov Report

Merging #9536 (6f31434) into main (012c4fa) will increase coverage by 0.81%.
Report is 10 commits behind head on main.
The diff coverage is 84.00%.

@@             Coverage Diff              @@
##               main    #9536      +/-   ##
============================================
+ Coverage     70.40%   71.21%   +0.81%     
- Complexity    56861    57582     +721     
============================================
  Files          4781     4781              
  Lines        271231   271247      +16     
  Branches      39599    39600       +1     
============================================
+ Hits         190947   193166    +2219     
+ Misses        63974    61934    -2040     
+ Partials      16310    16147     -163     
Files Changed Coverage Δ
...opensearch/action/get/TransportMultiGetAction.java 44.64% <50.00%> (+1.00%) ⬆️
.../org/opensearch/action/get/TransportGetAction.java 65.30% <83.33%> (-0.70%) ⬇️
...a/org/opensearch/cluster/routing/RoutingNodes.java 84.04% <83.33%> (-1.28%) ⬇️
...java/org/opensearch/cluster/metadata/Metadata.java 88.77% <100.00%> (+0.19%) ⬆️

... and 585 files with indirect coverage changes

Signed-off-by: Poojita Raj <[email protected]>
Signed-off-by: Poojita Raj <[email protected]>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

  • RESULT: UNSTABLE ❕
  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreStatsIT.testStatsOnRemoteStoreRestore

Signed-off-by: Poojita Raj <[email protected]>
@github-actions
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change 16c4751

Incompatible components

Incompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@Poojita-Raj
Copy link
Contributor Author

Gradle Check (Jenkins) Run Completed with:

* **RESULT:** FAILURE ❌

* **URL:** https://build.ci.opensearch.org/job/gradle-check/23757/

* **CommitID:** [16c4751](https://github.com/opensearch-project/OpenSearch/commit/16c4751ea64abb36755d281cd11a7655215d9f5f)
  Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green.
  Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change?

Flaky test: #9580

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

Signed-off-by: Poojita Raj <[email protected]>
@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Compatibility status:

Checks if related components are compatible with change 6f31434

Incompatible components

Incompatible components: [https://github.com/opensearch-project/cross-cluster-replication.git]

Skipped components

Compatible components

Compatible components: [https://github.com/opensearch-project/security.git, https://github.com/opensearch-project/alerting.git, https://github.com/opensearch-project/index-management.git, https://github.com/opensearch-project/sql.git, https://github.com/opensearch-project/anomaly-detection.git, https://github.com/opensearch-project/asynchronous-search.git, https://github.com/opensearch-project/job-scheduler.git, https://github.com/opensearch-project/observability.git, https://github.com/opensearch-project/common-utils.git, https://github.com/opensearch-project/k-nn.git, https://github.com/opensearch-project/reporting.git, https://github.com/opensearch-project/geospatial.git, https://github.com/opensearch-project/ml-commons.git, https://github.com/opensearch-project/notifications.git, https://github.com/opensearch-project/performance-analyzer.git, https://github.com/opensearch-project/neural-search.git, https://github.com/opensearch-project/performance-analyzer-rca.git, https://github.com/opensearch-project/security-analytics.git, https://github.com/opensearch-project/opensearch-oci-object-storage.git]

@Poojita-Raj
Copy link
Contributor Author

Gradle Check (Jenkins) Run Completed with:

* **RESULT:** FAILURE ❌

* **URL:** https://build.ci.opensearch.org/job/gradle-check/23845/

* **CommitID:** [6f31434](https://github.com/opensearch-project/OpenSearch/commit/6f31434f858ed0ca2e0c2526e7ced374a3452ade)
  Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green.
  Is the failure [a flaky test](https://github.com/opensearch-project/OpenSearch/blob/main/DEVELOPER_GUIDE.md#flaky-tests) unrelated to your change?

#9598

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@github-actions
Copy link
Contributor

Gradle Check (Jenkins) Run Completed with:

@mch2 mch2 merged commit ff65403 into opensearch-project:main Aug 31, 2023
@mch2 mch2 added the backport 2.x Backport to 2.x branch label Aug 31, 2023
opensearch-trigger-bot bot pushed a commit that referenced this pull request Aug 31, 2023
* pick oldest OS version replica to promote as primary

Signed-off-by: Poojita Raj <[email protected]>

* add test

Signed-off-by: Poojita Raj <[email protected]>

* refactor

Signed-off-by: Poojita Raj <[email protected]>

* refactor to avoid coupling

Signed-off-by: Poojita Raj <[email protected]>

* add comments

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[email protected]>
(cherry picked from commit ff65403)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotwanikunal pushed a commit that referenced this pull request Aug 31, 2023
…9652)

* pick oldest OS version replica to promote as primary



* add test



* refactor



* refactor to avoid coupling



* add comments



---------


(cherry picked from commit ff65403)

Signed-off-by: Poojita Raj <[email protected]>
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>
kaushalmahi12 pushed a commit to kaushalmahi12/OpenSearch that referenced this pull request Sep 12, 2023
…ch-project#9536)

* pick oldest OS version replica to promote as primary

Signed-off-by: Poojita Raj <[email protected]>

* add test

Signed-off-by: Poojita Raj <[email protected]>

* refactor

Signed-off-by: Poojita Raj <[email protected]>

* refactor to avoid coupling

Signed-off-by: Poojita Raj <[email protected]>

* add comments

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[email protected]>
Signed-off-by: Kaushal Kumar <[email protected]>
brusic pushed a commit to brusic/OpenSearch that referenced this pull request Sep 25, 2023
…ch-project#9536)

* pick oldest OS version replica to promote as primary

Signed-off-by: Poojita Raj <[email protected]>

* add test

Signed-off-by: Poojita Raj <[email protected]>

* refactor

Signed-off-by: Poojita Raj <[email protected]>

* refactor to avoid coupling

Signed-off-by: Poojita Raj <[email protected]>

* add comments

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[email protected]>
Signed-off-by: Ivan Brusic <[email protected]>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
…ch-project#9536)

* pick oldest OS version replica to promote as primary

Signed-off-by: Poojita Raj <[email protected]>

* add test

Signed-off-by: Poojita Raj <[email protected]>

* refactor

Signed-off-by: Poojita Raj <[email protected]>

* refactor to avoid coupling

Signed-off-by: Poojita Raj <[email protected]>

* add comments

Signed-off-by: Poojita Raj <[email protected]>

---------

Signed-off-by: Poojita Raj <[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 skip-changelog
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Segment Replication] Handle failover in mixed cluster mode
4 participants