Skip to content

Bugfixes for settings-related API calls. #5

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

Merged
merged 2 commits into from
May 18, 2015

Conversation

magnusbaeck
Copy link
Contributor

No description provided.

Starting with Elasticsearch 1.0 (probably), the previously
flat settings dictionaries returned by the /_settings and
/_cluster/settings endpoints became nested, i.e. instead of
getting back

    {
      "transient": {
        "cluster.routing.allocation.disable_allocation": "false"
      }
    }

we get

    {
      "transient": {
        "cluster": {
          "routing": {
            "allocation": {
              "disable_allocation": "false"
            }
          }
        }
      }
    }

which causes us to not recognize what settings we have, leading to
a failing assertion. We now try both ways of accessing the settings
dictionaries to remain compatible with both Elasticsearch 0.x and 1.x.

Closes bug anchor#4.
Previously, if no indexes had the disable_flush option set to any
value at all (i.e. get_index_translog_disable_flush() only returned
'unknown' values), flushing_disabled() would return 'enabled'
instead of 'unknown' because of the fallback when there was only
one unique state value. This commit rewrites that logic so that
it's easier to follow, if a bit less efficient.
@magnusbaeck
Copy link
Contributor Author

Wasn't sure if you preferred this as one or two PRs. Would be happy to split them up.

@olorin
Copy link
Contributor

olorin commented May 18, 2015

Thanks. One PR is fine - the important thing is that the commits are separate.

olorin added a commit that referenced this pull request May 18, 2015
Bugfixes for settings-related API calls.
@olorin olorin merged commit 80b5adf into anchor:master May 18, 2015
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.

2 participants