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

`cluster.routing.allocation.disk.threshold_enabled` accepts wrong values #9309

Closed
konradkonrad opened this issue Jan 15, 2015 · 2 comments

Comments

@konradkonrad
Copy link
Contributor

commented Jan 15, 2015

I found this on 1.1.2 -- if it is already fixed in later versions feel free to close:

The cluster-settings-API happily accepts the string "true" for the cluster.routing.allocation.disk.threshold_enabled setting. But -- otherwise I wouldn't file this issue -- "true" is not interpreted as boolean TRUE. This makes for a rather dangerous and difficult to spot user error. Since there is already some parsing in place, that neglects wrong settings, I would expect a non boolean-y string value in the settings JSON to be neglected for boolean settings. I haven't tested other cluster settings were this could occur.

Example settings:

curl http://localhost:9200/_cluster/settings?pretty
{
    "persistent":{
        "cluster":{
            "routing":{
                "allocation":{
                    "disk":{
                        "watermark":{
                            "low":"0.85",
                            "high":"0.95"
                        },
                        "threshold_enabled":"true"
                    }
                }
            }
        }
    }
}

With the above settings, the disk.watermark setting is inactive!

@dakrone

This comment has been minimized.

Copy link
Member

commented Jan 15, 2015

@konradkonrad thanks for finding this, I will fix it

@dakrone dakrone self-assigned this Jan 15, 2015

@dakrone dakrone closed this in 5acf565 Jan 15, 2015

dakrone added a commit that referenced this issue Jan 15, 2015
Add validator for `cluster.routing.allocation.disk` boolean settings
`cluster.routing.allocation.disk.include_relocations` and
`cluster.routing.allocation.disk.reroute_interval` are both boolean
settings, so they should have the `Validator.BOOLEAN` applied.

Fixes #9309
@konradkonrad

This comment has been minimized.

Copy link
Contributor Author

commented Jan 15, 2015

Wow! That was fast, thanks @dakrone :)

dakrone added a commit that referenced this issue Jan 15, 2015
Add validator for `cluster.routing.allocation.disk` boolean settings
`cluster.routing.allocation.disk.include_relocations` and
`cluster.routing.allocation.disk.reroute_interval` are both boolean
settings, so they should have the `Validator.BOOLEAN` applied.

Fixes #9309
dakrone added a commit that referenced this issue Jan 15, 2015
Add validator for `cluster.routing.allocation.disk` boolean settings
`cluster.routing.allocation.disk.threshold_enabled` is a boolean
setting, so it should have the `Validator.BOOLEAN` applied.

Fixes #9309

Conflicts:
	src/main/java/org/elasticsearch/cluster/settings/ClusterDynamicSettingsModule.java

@clintongormley clintongormley changed the title cluster.routing.allocation.disk.threshold_enabled accepts wrong values Settings: cluster.routing.allocation.disk.threshold_enabled accepts wrong values Feb 10, 2015

@clintongormley clintongormley changed the title Settings: cluster.routing.allocation.disk.threshold_enabled accepts wrong values `cluster.routing.allocation.disk.threshold_enabled` accepts wrong values Jun 8, 2015

mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Add validator for `cluster.routing.allocation.disk` boolean settings
`cluster.routing.allocation.disk.include_relocations` and
`cluster.routing.allocation.disk.reroute_interval` are both boolean
settings, so they should have the `Validator.BOOLEAN` applied.

Fixes elastic#9309
mute pushed a commit to mute/elasticsearch that referenced this issue Jul 29, 2015
Add validator for `cluster.routing.allocation.disk` boolean settings
`cluster.routing.allocation.disk.threshold_enabled` is a boolean
setting, so it should have the `Validator.BOOLEAN` applied.

Fixes elastic#9309

Conflicts:
	src/main/java/org/elasticsearch/cluster/settings/ClusterDynamicSettingsModule.java
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants
You can’t perform that action at this time.