-
Notifications
You must be signed in to change notification settings - Fork 24.9k
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
drop index.shard.check_on_startup: fix
#32279
Changes from 10 commits
843f977
4f01609
153e4f2
2964fef
c71e306
a7668d6
97fa399
c155b36
85b7eef
3231803
c2b5b8a
14e6175
fee8a5b
5cee2b9
ad62da0
6f6ca5a
6763cf9
5083e83
2a9dbeb
aa16487
d26fbfb
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
/* | ||
* Licensed to Elasticsearch under one or more contributor | ||
* license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright | ||
* ownership. Elasticsearch licenses this file to you under | ||
* the Apache License, Version 2.0 (the "License"); you may | ||
* not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, | ||
* software distributed under the License is distributed on an | ||
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
* KIND, either express or implied. See the License for the | ||
* specific language governing permissions and limitations | ||
* under the License. | ||
*/ | ||
package org.elasticsearch.index.shard; | ||
|
||
import org.elasticsearch.common.logging.DeprecationLogger; | ||
import org.elasticsearch.common.settings.Settings; | ||
import org.elasticsearch.common.util.concurrent.ThreadContext; | ||
import org.elasticsearch.index.IndexSettings; | ||
|
||
import java.util.List; | ||
import java.util.Map; | ||
|
||
import static org.hamcrest.Matchers.containsString; | ||
import static org.hamcrest.Matchers.hasSize; | ||
|
||
public class IndexShardDeprecatedSettingTests extends IndexShardTestCase { | ||
@Override | ||
protected boolean enableWarningsCheck() { | ||
return false; | ||
} | ||
|
||
public void testCheckOnStartupDeprecatedValue() throws Exception { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think this could be simplified to:
(and using There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. already figured that out ;) |
||
final Settings settings = Settings.builder().put(IndexSettings.INDEX_CHECK_ON_STARTUP.getKey(), "fix").build(); | ||
|
||
try(ThreadContext threadContext = new ThreadContext(Settings.EMPTY)) { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: missing whitespace after the |
||
DeprecationLogger.setThreadContext(threadContext); | ||
final IndexShard newShard = newShard(true, settings); | ||
|
||
final Map<String, List<String>> responseHeaders = threadContext.getResponseHeaders(); | ||
final List<String> warnings = responseHeaders.get("Warning"); | ||
assertThat(warnings.toString(), warnings, hasSize(1)); | ||
assertThat(warnings.get(0), containsString("Setting [index.shard.check_on_startup] is set to deprecated value [fix], " | ||
+ "which will be unsupported in future")); | ||
|
||
closeShards(newShard); | ||
} | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggest
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
++ thanks