updating non dynamic settings throws an error now
This commit is contained in:
parent
2193a8e401
commit
f41eccc7a5
|
@ -19,6 +19,7 @@
|
|||
|
||||
package org.elasticsearch.test.integration.indices.settings;
|
||||
|
||||
import org.elasticsearch.ElasticSearchIllegalArgumentException;
|
||||
import org.elasticsearch.cluster.metadata.IndexMetaData;
|
||||
import org.elasticsearch.common.settings.ImmutableSettings;
|
||||
import org.elasticsearch.test.integration.AbstractNodesTests;
|
||||
|
@ -52,17 +53,31 @@ public class UpdateSettingsTests extends AbstractNodesTests {
|
|||
|
||||
client("node1").admin().indices().prepareCreate("test").execute().actionGet();
|
||||
|
||||
try {
|
||||
client("node1").admin().indices().prepareUpdateSettings("test")
|
||||
.setSettings(ImmutableSettings.settingsBuilder()
|
||||
.put("index.refresh_interval", -1) // this one can change
|
||||
.put("index.cache.filter.type", "none") // this one can't
|
||||
)
|
||||
.execute().actionGet();
|
||||
assert false;
|
||||
} catch (ElasticSearchIllegalArgumentException e) {
|
||||
// all is well
|
||||
}
|
||||
|
||||
IndexMetaData indexMetaData = client("node1").admin().cluster().prepareState().execute().actionGet().getState().metaData().index("test");
|
||||
assertThat(indexMetaData.settings().get("index.refresh_interval"), equalTo("-1"));
|
||||
assertThat(indexMetaData.settings().get("index.refresh_interval"), nullValue());
|
||||
assertThat(indexMetaData.settings().get("index.cache.filter.type"), nullValue());
|
||||
|
||||
client("node1").admin().indices().prepareUpdateSettings("test")
|
||||
.setSettings(ImmutableSettings.settingsBuilder()
|
||||
.put("index.refresh_interval", -1) // this one can change
|
||||
)
|
||||
.execute().actionGet();
|
||||
|
||||
indexMetaData = client("node1").admin().cluster().prepareState().execute().actionGet().getState().metaData().index("test");
|
||||
assertThat(indexMetaData.settings().get("index.refresh_interval"), equalTo("-1"));
|
||||
|
||||
// now close the index, change the non dynamic setting, and see that it applies
|
||||
|
||||
client("node1").admin().indices().prepareClose("test").execute().actionGet();
|
||||
|
|
Loading…
Reference in New Issue