Skip to content

Deprecation headers are not returned when deleting a non existing setting #26419

@spinscale

Description

@spinscale

Elasticsearch version (bin/elasticsearch --version): 5.5 (tested on 5.5.1)

OS version (uname -a if on a Unix-like system): osx

Description of the problem including expected versus actual behavior:

When you have a deprecated setting configured, then the cluster update settings API is returning all of those settings on every request, regardless if the setting you specified as part of the request is affected.

However when trying to unset an already unset setting, the header suddenly vanishes.

Steps to reproduce:

bin/elasticsearch -Eingest.new_date_format=false

Set another setting, see the correct header returned for the setting specified on startup

# curl -v -X PUT localhost:9200/_cluster/settings -d '{ "transient" : { "script.max_compilations_per_minute" : 15 } }' --header "Content-Type: application/json"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9200 (#0)
> PUT /_cluster/settings HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 63
>
* upload completely sent off: 63 out of 63 bytes
< HTTP/1.1 200 OK
< Warning: 299 Elasticsearch-5.5.1-19c13d0 "[ingest.new_date_format] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." "Tue, 29 Aug 2017 12:29:56 GMT"
< content-type: application/json; charset=UTF-8
< content-length: 97
<
* Connection #0 to host localhost left intact
{"acknowledged":true,"persistent":{},"transient":{"script":{"max_compilations_per_minute":"15"}}}%

Remove the script compilation setting by setting it to null, see the header for the startup setting being returned

# curl -v -X PUT localhost:9200/_cluster/settings -d '{ "transient" : { "script.max_compilations_per_minute" : null } }' --header "Content-Type: application/json"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9200 (#0)
> PUT /_cluster/settings HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 65
>
* upload completely sent off: 65 out of 65 bytes
< HTTP/1.1 200 OK
< Warning: 299 Elasticsearch-5.5.1-19c13d0 "[ingest.new_date_format] setting was deprecated in Elasticsearch and will be removed in a future release! See the breaking changes documentation for the next major version." "Tue, 29 Aug 2017 12:31:06 GMT"
< content-type: application/json; charset=UTF-8
< content-length: 52
<
* Connection #0 to host localhost left intact
{"acknowledged":true,"persistent":{},"transient":{}}%

Do the above call for a second time, see no headers

curl -v -X PUT localhost:9200/_cluster/settings -d '{ "transient" : { "script.max_compilations_per_minute" : null } }' --header "Content-Type: application/json"
*   Trying 127.0.0.1...
* TCP_NODELAY set
* Connected to localhost (127.0.0.1) port 9200 (#0)
> PUT /_cluster/settings HTTP/1.1
> Host: localhost:9200
> User-Agent: curl/7.54.0
> Accept: */*
> Content-Type: application/json
> Content-Length: 65
>
* upload completely sent off: 65 out of 65 bytes
< HTTP/1.1 200 OK
< content-type: application/json; charset=UTF-8
< content-length: 52
<
* Connection #0 to host localhost left intact
{"acknowledged":true,"persistent":{},"transient":{}}%

Metadata

Metadata

Assignees

No one assigned

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions