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

Empty dir error in datanode inplace migration #20912

Merged
merged 11 commits into from
Nov 14, 2024

Conversation

todvora
Copy link
Contributor

@todvora todvora commented Nov 7, 2024

Empty opensearch_data_location should be reported as invalid configuration for the inplace migration. If it's empty and users are trying to migrate, it's most likely an error in configuration, their actual data is somewhere else that they are telling us.

/nocl

Screenshots (if appropriate):

image

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Refactoring (non-breaking change)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.

@todvora todvora force-pushed the fix/block-empty-dir-inplace-migration branch from 09bb5fa to 7639e2b Compare November 7, 2024 12:25
Copy link
Contributor

@moesterheld moesterheld left a comment

Choose a reason for hiding this comment

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

I would not stop them from migrating, only warn them. Without remote reindexing, this is currently the only way to switch to data node if you don't care about migrating data

@todvora
Copy link
Contributor Author

todvora commented Nov 12, 2024

@moesterheld added warnings to the compatibility check and remove the error in case of empty data directory.

@gally47 could you please extend the frontend implementation, so it displays warning? The current response format looks like this:

{
  "tdvorak-ThinkPad-T14s-Gen-1": {
    "hostname": "tdvorak-ThinkPad-T14s-Gen-1",
    "opensearch_version": "2.15.0",
    "info": {
      "nodes": [],
      "opensearch_data_location": "/home/tdvorak/bin/datanode/data"
    },
    "compatibility_errors": [],
    "compatibility_warnings": [
      "Your configured opensearch_data_location directory /home/tdvorak/bin/datanode/data doesn't contain any indices! Migration can't continue!"
    ]
  }
}

Copy link
Contributor Author

@todvora todvora left a comment

Choose a reason for hiding this comment

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

Thanks @gally47, the frontend now works perfectly! Tested locally and everything looks good.

Copy link
Contributor

@moesterheld moesterheld left a comment

Choose a reason for hiding this comment

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

Tested and works fine. Backend lgtm, frontend as well.

@todvora todvora merged commit 60e1ca3 into master Nov 14, 2024
7 checks passed
@todvora todvora deleted the fix/block-empty-dir-inplace-migration branch November 14, 2024 13:14
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.

3 participants