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

Support index level allocation filtering for searchable snapshot index #11563

Conversation

bugmakerrrrrr
Copy link
Contributor

Description

Two changes here:

  1. Support index level allocation filtering for searchable snapshot index: filter out the shards that cannot remain on the current node and prioritize moving them to eligible nodes before considering moving shards on excluded nodes;
  2. Eliminate the logic of swapping primary with replica, as a shard cannot be transitioned from primary to replica mode.
    if (currentRouting.primary() && newRouting.primary() == false) {

Related Issues

Resolves #11468

Check List

  • New functionality includes testing.
    • All tests pass
  • New functionality has been documented.
    • New functionality has javadoc added
  • Failing checks are inspected and point to the corresponding known issue(s) (See: Troubleshooting Failing Builds)
  • Commits are signed per the DCO using --signoff
  • Commit changes are listed out in CHANGELOG.md file (See: Changelog)
  • Public documentation issue/PR created

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.

Copy link
Contributor

❌ Gradle check result for 15d2358: null

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?

@bugmakerrrrrr bugmakerrrrrr force-pushed the support_index_level_allocation_filter branch from 15d2358 to 1997226 Compare January 8, 2024 07:47
Copy link
Contributor

github-actions bot commented Jan 8, 2024

❕ Gradle check result for 1997226: UNSTABLE

  • TEST FAILURES:
      2 org.opensearch.index.shard.RemoteStoreRefreshListenerTests.classMethod
      1 org.opensearch.snapshots.CloneSnapshotIT.testCloneShallowSnapshotIndex
      1 org.opensearch.index.shard.RemoteStoreRefreshListenerTests.testRefreshAfterCommit

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 Jan 8, 2024

Codecov Report

Attention: 18 lines in your changes are missing coverage. Please review.

Comparison is base (5dd4b61) 71.38% compared to head (1997226) 70.70%.
Report is 1 commits behind head on main.

❗ Current head 1997226 differs from pull request most recent head 9925816. Consider uploading reports for the commit 9925816 to get more accurate results

Files Patch % Lines
...ing/allocation/allocator/RemoteShardsBalancer.java 53.84% 12 Missing and 6 partials ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #11563      +/-   ##
============================================
- Coverage     71.38%   70.70%   -0.68%     
+ Complexity    59354    58774     -580     
============================================
  Files          4923     4911      -12     
  Lines        279095   278674     -421     
  Branches      40559    40534      -25     
============================================
- Hits         199228   197043    -2185     
- Misses        63292    65191    +1899     
+ Partials      16575    16440     -135     

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

@bugmakerrrrrr
Copy link
Contributor Author

@kotwanikunal Could you please have a look?

Copy link
Member

@kotwanikunal kotwanikunal left a comment

Choose a reason for hiding this comment

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

Rest LGTM.

@bugmakerrrrrr bugmakerrrrrr force-pushed the support_index_level_allocation_filter branch from 1997226 to 1a59be8 Compare January 9, 2024 07:05
Copy link
Contributor

github-actions bot commented Jan 9, 2024

❌ Gradle check result for 1a59be8: 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?

@bugmakerrrrrr
Copy link
Contributor Author

Rest LGTM.

@kotwanikunal all relevant issues fixed

Signed-off-by: panguixin <panguixin@bytedance.com>
Signed-off-by: panguixin <panguixin@bytedance.com>
Signed-off-by: panguixin <panguixin@bytedance.com>
Signed-off-by: panguixin <panguixin@bytedance.com>
@andrross andrross force-pushed the support_index_level_allocation_filter branch from 1a59be8 to 9925816 Compare January 17, 2024 23:12
@andrross
Copy link
Member

I just pushed a rebase from main and fixed the conflict in the changelog

Copy link
Contributor

❌ Gradle check result for 1a59be8: 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?

Copy link
Contributor

❕ Gradle check result for 9925816: UNSTABLE

  • TEST FAILURES:
      2 org.opensearch.index.shard.RemoteStoreRefreshListenerTests.classMethod
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.testSnapshotDeleteRelocatingPrimaryIndex
      1 org.opensearch.snapshots.DedicatedClusterSnapshotRestoreIT.classMethod
      1 org.opensearch.index.shard.RemoteStoreRefreshListenerTests.testRefreshAfterCommit

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

@kotwanikunal kotwanikunal merged commit 2f81c57 into opensearch-project:main Jan 18, 2024
28 checks passed
@kotwanikunal kotwanikunal added the backport 2.x Backport to 2.x branch label Jan 18, 2024
opensearch-trigger-bot bot pushed a commit that referenced this pull request Jan 18, 2024
#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
(cherry picked from commit 2f81c57)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
@bugmakerrrrrr bugmakerrrrrr deleted the support_index_level_allocation_filter branch January 19, 2024 02:44
kotwanikunal pushed a commit that referenced this pull request Jan 22, 2024
#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
(cherry picked from commit 2f81c57)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotwanikunal pushed a commit that referenced this pull request Jan 24, 2024
#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
(cherry picked from commit 2f81c57)
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
kotwanikunal pushed a commit that referenced this pull request Jan 24, 2024
#11563) (#11927)

* support index level allocation filtering



* run spotless



* fix IT



* fix not statement and add change log



---------


(cherry picked from commit 2f81c57)

Signed-off-by: panguixin <panguixin@bytedance.com>
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>
peteralfonsi pushed a commit to peteralfonsi/OpenSearch that referenced this pull request Mar 1, 2024
opensearch-project#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
rayshrey pushed a commit to rayshrey/OpenSearch that referenced this pull request Mar 18, 2024
opensearch-project#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
shiv0408 pushed a commit to Gaurav614/OpenSearch that referenced this pull request Apr 25, 2024
opensearch-project#11563)

* support index level allocation filtering

Signed-off-by: panguixin <panguixin@bytedance.com>

* run spotless

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix IT

Signed-off-by: panguixin <panguixin@bytedance.com>

* fix not statement and add change log

Signed-off-by: panguixin <panguixin@bytedance.com>

---------

Signed-off-by: panguixin <panguixin@bytedance.com>
Signed-off-by: Shivansh Arora <hishiv@amazon.com>
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 enhancement Enhancement or improvement to existing feature or request Search:Remote Search
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Searchable snapshot supports index level allocation filter settings
3 participants