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

Update index settings during remote store migration #12748

Merged

Conversation

ltaragi
Copy link
Contributor

@ltaragi ltaragi commented Mar 19, 2024

Description

  • For MIXED compatibility mode and REMOTE_STORE migration direction:
    • New indices should be remote store backed
    • New indices restored from a snapshot must be remote store backed irrespective of whether the original index was remote store backed or not
    • This is accomplished as follows:
      • updateRemoteStoreSettings looks for the MIGRATION_DIRECTION_SETTING and REMOTE_STORE_COMPATIBILITY_MODE_SETTING inside the clusterSettings object
      • Upon finding REMOTE_STORE and MIXED values respectively, it obtains the REMOTE_STORE_TRANSLOG_REPOSITORY_NAME and REMOTE_STORE_SEGMENT_REPOSITORY_NAME from any of the remote nodes in the mixed cluster. Information of nodes is obtained from the clusterState object.
      • Upon finding both repositories, it marks the SETTING_REMOTE_STORE_ENABLED as true for the index settings.

Related Issues

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 c19e881: 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

github-actions bot commented Mar 19, 2024

Compatibility status:

Checks if related components are compatible with change 53c1989

Incompatible components

Skipped components

Compatible components

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

@ltaragi ltaragi force-pushed the remote-store-migration-settings branch 2 times, most recently from 501b052 to e605b95 Compare March 19, 2024 07:33
Copy link
Contributor

❌ Gradle check result for 501b052: 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 e605b95: 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?

@linuxpi
Copy link
Collaborator

linuxpi commented Mar 22, 2024

@ltaragi can you please add more details to the description and link the related issue

@linuxpi
Copy link
Collaborator

linuxpi commented Mar 22, 2024

if the PR is ready, lets publish it. its currently in draft

@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Storage:Durability Issues and PRs related to the durability framework Storage:Remote labels Mar 23, 2024
Copy link
Contributor

❌ Gradle check result for 51cc9df: 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?

@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from 51cc9df to 5e3b82a Compare April 1, 2024 10:32
Copy link
Contributor

github-actions bot commented Apr 1, 2024

❌ Gradle check result for 5e3b82a: 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?

@ltaragi ltaragi removed enhancement Enhancement or improvement to existing feature or request Storage:Durability Issues and PRs related to the durability framework Storage:Remote labels Apr 1, 2024
Copy link
Contributor

github-actions bot commented Apr 1, 2024

✅ Gradle check result for 4c23b6b: SUCCESS

Copy link

codecov bot commented Apr 1, 2024

Codecov Report

Attention: Patch coverage is 88.09524% with 5 lines in your changes are missing coverage. Please review.

Project coverage is 71.45%. Comparing base (b15cb0c) to head (53c1989).
Report is 156 commits behind head on main.

Files Patch % Lines
...h/cluster/metadata/MetadataCreateIndexService.java 93.93% 0 Missing and 2 partials ⚠️
.../java/org/opensearch/snapshots/RestoreService.java 66.66% 0 Missing and 2 partials ⚠️
...earch/node/remotestore/RemoteStoreNodeService.java 66.66% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@             Coverage Diff              @@
##               main   #12748      +/-   ##
============================================
+ Coverage     71.42%   71.45%   +0.03%     
- Complexity    59978    60556     +578     
============================================
  Files          4985     5033      +48     
  Lines        282275   284972    +2697     
  Branches      40946    41299     +353     
============================================
+ Hits         201603   203636    +2033     
- Misses        63999    64511     +512     
- Partials      16673    16825     +152     

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

@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from 4c23b6b to 8e55204 Compare April 1, 2024 17:58
@github-actions github-actions bot added enhancement Enhancement or improvement to existing feature or request Storage:Durability Issues and PRs related to the durability framework Storage:Remote labels Apr 1, 2024
@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from 8e55204 to c0aca30 Compare April 1, 2024 18:29
Copy link
Contributor

github-actions bot commented Apr 1, 2024

✅ Gradle check result for 8e55204: SUCCESS

Signed-off-by: Lakshya Taragi <[email protected]>
@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from b1c049e to fe8d1b5 Compare April 12, 2024 04:39
Copy link
Contributor

✅ Gradle check result for fe8d1b5: SUCCESS

Copy link
Collaborator

@linuxpi linuxpi left a comment

Choose a reason for hiding this comment

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

LGTM, some minor changes in UTs

Copy link
Contributor

❌ Gradle check result for 51c5705: 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
Collaborator

@gbbafna gbbafna left a comment

Choose a reason for hiding this comment

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

Good to see that docrep direction is also potentially handled in this PR itself . Thanks Lakshya and Varun.

Copy link
Contributor

❌ Gradle check result for 2931a1c: 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?

Signed-off-by: Lakshya Taragi <[email protected]>
@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from 2931a1c to b0549e5 Compare April 12, 2024 12:01
Signed-off-by: Lakshya Taragi <[email protected]>
@ltaragi ltaragi force-pushed the remote-store-migration-settings branch from 0028922 to 53c1989 Compare April 12, 2024 12:39
Copy link
Contributor

❌ Gradle check result for b0549e5: 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 0028922: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.cluster.MinimumClusterManagerNodesIT.testThreeNodesNoClusterManagerBlock

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
Contributor

❕ Gradle check result for 53c1989: UNSTABLE

  • TEST FAILURES:
      1 org.opensearch.remotestore.RemoteStoreStatsIT.testDownloadStatsCorrectnessSinglePrimaryMultipleReplicaShards
      1 org.opensearch.cluster.allocation.ClusterRerouteIT.testDelayWithALargeAmountOfShards

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

@gbbafna gbbafna merged commit c168e1c into opensearch-project:main Apr 12, 2024
31 checks passed
@gbbafna gbbafna added the backport 2.x Backport to 2.x branch label Apr 12, 2024
@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:

# Navigate to the root of your repository
cd $(git rev-parse --show-toplevel)
# Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add ../.worktrees/OpenSearch/backport-2.x 2.x
# Navigate to the new working tree
pushd ../.worktrees/OpenSearch/backport-2.x
# Create a new branch
git switch --create backport/backport-12748-to-2.x
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 c168e1c9216ba914fcd5c310ffb070df8ef5e6b5
# Push it to GitHub
git push --set-upstream origin backport/backport-12748-to-2.x
# Go back to the original working tree
popd
# Delete the working tree
git worktree remove ../.worktrees/OpenSearch/backport-2.x

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

ltaragi added a commit to ltaragi/OpenSearch that referenced this pull request Apr 15, 2024
gbbafna pushed a commit that referenced this pull request Apr 15, 2024
Signed-off-by: Lakshya Taragi <[email protected]>
(cherry picked from commit c168e1c)
if (RemoteStoreNodeAttribute.isRemoteStoreAttributePresent(clusterService.getSettings()) == true
|| clusterSettings.get(IndicesService.CLUSTER_INDEX_RESTRICT_REPLICATION_TYPE_SETTING) == true) {
Copy link
Contributor

Choose a reason for hiding this comment

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

this logic might not work well during remote store -> docrep migration. so, this code runs in cluster manager node, if during migration from remote store -> docrep, user updates setting of one of the non cluster manager node first and if cluster manager still have the remote store attributes this will restore the indices as remote store enabled.

Copy link
Contributor

Choose a reason for hiding this comment

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

we should maybe check (if mode is STRICT and remote store attribute is present) || (migration to remote is ongoing).

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 backport-failed enhancement Enhancement or improvement to existing feature or request skip-changelog Storage:Durability Issues and PRs related to the durability framework Storage:Remote
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

[Remote Store] Update remote store index settings for mixed cluster
5 participants