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

[BUG] Unable to clear remote_store.compatibility_mode setting #13634

Closed
BhumikaSaini-Amazon opened this issue May 13, 2024 · 0 comments · Fixed by #13646
Closed

[BUG] Unable to clear remote_store.compatibility_mode setting #13634

BhumikaSaini-Amazon opened this issue May 13, 2024 · 0 comments · Fixed by #13646
Assignees
Labels
bug Something isn't working good first issue Good for newcomers low hanging fruit Storage:Remote Storage Issues and PRs relating to data and metadata storage v2.15.0 Issues and PRs related to version 2.15.0

Comments

@BhumikaSaini-Amazon
Copy link
Contributor

Describe the bug

Once set in the cluster settings, there isn't a way to clear the remote_store.compatibility_mode setting

Related component

Storage

To Reproduce

  1. Run a docrep cluster to remote-backed cluster migration (steps added in PR https://github.com/opensearch-project/documentation-website/pull/7121/files)

  2. Try to clear the compatibility_mode setting:

    PUT "/_cluster/settings?pretty"
    {
        "persistent": {
            "remote_store.compatibility_mode": null
        }
    }

Expected behavior

The setting should get cleared

Additional Details

Error response

{
  "error" : {
    "root_cause" : [
      {
        "type" : "null_pointer_exception",
        "reason" : "Cannot invoke \"String.toLowerCase(java.util.Locale)\" because the return value of \"org.opensearch.common.settings.Settings.get(String)\" is null"
      }
    ],
    "type" : "null_pointer_exception",
    "reason" : "Cannot invoke \"String.toLowerCase(java.util.Locale)\" because the return value of \"org.opensearch.common.settings.Settings.get(String)\" is null"
  },
  "status" : 500
}

Proposed solution
We seem to be missing a null check in validateCompatibilityModeSettingRequest( ):

String value = settings.get(RemoteStoreNodeService.REMOTE_STORE_COMPATIBILITY_MODE_SETTING.getKey()).toLowerCase(Locale.ROOT);

Adding that should fix this

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers low hanging fruit Storage:Remote Storage Issues and PRs relating to data and metadata storage v2.15.0 Issues and PRs related to version 2.15.0
Projects
Status: ✅ Done
Development

Successfully merging a pull request may close this issue.

1 participant