Hide I/SLM history aliases (#53564)

This commit adjusts the aliases used for the ILM and SLM history indices
to be hidden aliases.

Also tweaks the configuration of the `IndexTemplateRegistry`s used by
these history system to only upgrade the template from the master node,
as documents are indexed from the master node, so the template version
should only be upgraded from the master node.
This commit is contained in:
Gordon Brown 2020-03-16 13:07:26 -06:00 committed by GitHub
parent f7482f794a
commit 880cc3ca7e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 13 additions and 2 deletions

View File

@ -98,7 +98,8 @@ public class SnapshotHistoryStore {
client.admin().indices().prepareCreate(initialHistoryIndexName)
.setWaitForActiveShards(1)
.addAlias(new Alias(SLM_HISTORY_ALIAS)
.writeIndex(true))
.writeIndex(true)
.isHidden(true))
.execute(new ActionListener<CreateIndexResponse>() {
@Override
public void onResponse(CreateIndexResponse response) {

View File

@ -43,6 +43,11 @@ public class SnapshotLifecycleTemplateRegistry extends IndexTemplateRegistry {
public static final String SLM_POLICY_NAME = "slm-history-ilm-policy";
@Override
protected boolean requiresMasterNode() {
return true;
}
public static final IndexTemplateConfig TEMPLATE_SLM_HISTORY = new IndexTemplateConfig(
SLM_TEMPLATE_NAME,
"/slm-history.json",

View File

@ -187,7 +187,7 @@ public class ILMHistoryStore implements Closeable {
.setSettings((Map<String, ?>) templateAsMap.get("settings"))
.addMapping("_doc", (Map<String, Object>) templateAsMap.get("mappings"))
.setWaitForActiveShards(1)
.addAlias(new Alias(ILM_HISTORY_ALIAS).writeIndex(true))
.addAlias(new Alias(ILM_HISTORY_ALIAS).writeIndex(true).isHidden(true))
.execute(new ActionListener<CreateIndexResponse>() {
@Override
public void onResponse(CreateIndexResponse response) {

View File

@ -35,6 +35,11 @@ public class ILMHistoryTemplateRegistry extends IndexTemplateRegistry {
public static final String ILM_POLICY_NAME = "ilm-history-ilm-policy";
@Override
protected boolean requiresMasterNode() {
return true;
}
public static final IndexTemplateConfig TEMPLATE_ILM_HISTORY = new IndexTemplateConfig(
ILM_TEMPLATE_NAME,
"/ilm-history.json",