From f1028fbbcce4fadf0173f664d1c97151e9fb6901 Mon Sep 17 00:00:00 2001 From: Martijn van Groningen Date: Wed, 15 Jul 2020 22:22:01 +0200 Subject: [PATCH] Only install stack templates via elected master node (#59624) (#59657) to avoid many error stacktraces in logs during a rolling upgrade. Stack templates use the composable index template and component APIs,these APIs aren't supported in 7.7 and earlier and in mixed cluster environments this can cause a lot of ActionNotFoundTransportException errors in the logs during rolling upgrades. If these templates are only installed via elected master node then the APIs are always there and the ActionNotFoundTransportException errors are then prevented. --- .../xpack/stack/StackTemplateRegistry.java | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java index fbdbaa1a9cd..e1ae7282650 100644 --- a/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java +++ b/x-pack/plugin/stack/src/main/java/org/elasticsearch/xpack/stack/StackTemplateRegistry.java @@ -137,4 +137,15 @@ public class StackTemplateRegistry extends IndexTemplateRegistry { protected String getOrigin() { return ClientHelper.STACK_ORIGIN; } + + @Override + protected boolean requiresMasterNode() { + // Stack templates use the composable index template and component APIs, + // these APIs aren't supported in 7.7 and earlier and in mixed cluster + // environments this can cause a lot of ActionNotFoundTransportException + // errors in the logs during rolling upgrades. If these templates + // are only installed via elected master node then the APIs are always + // there and the ActionNotFoundTransportException errors are then prevented. + return true; + } }