Skip to content

Commit 6d6eb08

Browse files
committed
Hide I/SLM history aliases (elastic#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.
1 parent 031932b commit 6d6eb08

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotHistoryStore.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,8 @@ static void ensureHistoryIndex(Client client, ClusterState state, ActionListener
9898
client.admin().indices().prepareCreate(initialHistoryIndexName)
9999
.setWaitForActiveShards(1)
100100
.addAlias(new Alias(SLM_HISTORY_ALIAS)
101-
.writeIndex(true))
101+
.writeIndex(true)
102+
.isHidden(true))
102103
.execute(new ActionListener<CreateIndexResponse>() {
103104
@Override
104105
public void onResponse(CreateIndexResponse response) {

x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/slm/history/SnapshotLifecycleTemplateRegistry.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,11 @@ public class SnapshotLifecycleTemplateRegistry extends IndexTemplateRegistry {
4343

4444
public static final String SLM_POLICY_NAME = "slm-history-ilm-policy";
4545

46+
@Override
47+
protected boolean requiresMasterNode() {
48+
return true;
49+
}
50+
4651
public static final IndexTemplateConfig TEMPLATE_SLM_HISTORY = new IndexTemplateConfig(
4752
SLM_TEMPLATE_NAME,
4853
"/slm-history.json",

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -187,7 +187,7 @@ static void ensureHistoryIndex(Client client, ClusterState state, ActionListener
187187
.setSettings((Map<String, ?>) templateAsMap.get("settings"))
188188
.addMapping("_doc", (Map<String, Object>) templateAsMap.get("mappings"))
189189
.setWaitForActiveShards(1)
190-
.addAlias(new Alias(ILM_HISTORY_ALIAS).writeIndex(true))
190+
.addAlias(new Alias(ILM_HISTORY_ALIAS).writeIndex(true).isHidden(true))
191191
.execute(new ActionListener<CreateIndexResponse>() {
192192
@Override
193193
public void onResponse(CreateIndexResponse response) {

x-pack/plugin/ilm/src/main/java/org/elasticsearch/xpack/ilm/history/ILMHistoryTemplateRegistry.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,11 @@ public class ILMHistoryTemplateRegistry extends IndexTemplateRegistry {
3535

3636
public static final String ILM_POLICY_NAME = "ilm-history-ilm-policy";
3737

38+
@Override
39+
protected boolean requiresMasterNode() {
40+
return true;
41+
}
42+
3843
public static final IndexTemplateConfig TEMPLATE_ILM_HISTORY = new IndexTemplateConfig(
3944
ILM_TEMPLATE_NAME,
4045
"/ilm-history.json",

0 commit comments

Comments
 (0)