Skip to content

Commit 91d0fd8

Browse files
committed
QA: Preserve templates and snapshot on upgrades
Monitoring wasn't consistently creating its templates when the rolling upgrade test case was running against the zip distribution. It looked like the templates were being removed as soon as they were created: ``` [2018-05-29T15:33:38,311][DEBUG][o.e.c.s.ClusterApplierService] [node-0] processing [apply cluster state (from master [master {node-0}{9cTSjfGtQyeoSNxIRF_BdQ}{SI9wsZjeQUKAAhBavEnOPQ}{127.0.0.1}{127.0.0.1:45985}{ml.machine_memory=33651564544, xpack.installed=true, testattr=test, ml.max_open_jobs=20, ml.enabled=true} committed version [160] source [create-index-template [.monitoring-kibana], cause [api]]])]: took [11ms] done applying updated cluster state (version: 160, uuid: z0cPB7DkQceXohOOzYgRRg) [2018-05-29T15:33:40,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node-0] removing template [.monitoring-es] [2018-05-29T15:33:40,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node-0] removing template [.monitoring-alerts] [2018-05-29T15:33:40,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node-0] removing template [.monitoring-kibana] [2018-05-29T15:33:40,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node-0] removing template [.monitoring-logstash] [2018-05-29T15:33:40,752][INFO ][o.e.c.m.MetaDataIndexTemplateService] [node-0] removing template [.monitoring-beats] ``` It turns out that this was my fault. I had configured the tests to delete the templates. This change configures the tests to keep the templates and any snapshots we make for good measure. This causes the `.monitoring-*` templates to be in the cluster state when we look for them. Closes #30925
1 parent 595c130 commit 91d0fd8

File tree

3 files changed

+27
-2
lines changed

3 files changed

+27
-2
lines changed

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/AbstractRollingTestCase.java

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,16 @@ protected final boolean preserveReposUponCompletion() {
5353
return true;
5454
}
5555

56+
@Override
57+
protected boolean preserveTemplatesUponCompletion() {
58+
return true;
59+
}
60+
61+
@Override
62+
protected boolean preserveSnapshotsUponCompletion() {
63+
return true;
64+
}
65+
5666
@Override
5767
protected final Settings restClientSettings() {
5868
return Settings.builder().put(super.restClientSettings())

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/UpgradeClusterClientYamlTestSuiteIT.java

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,22 @@
3131
public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {
3232

3333
@Override
34-
protected boolean preserveIndicesUponCompletion() {
34+
protected final boolean preserveIndicesUponCompletion() {
3535
return true;
3636
}
3737

3838
@Override
39-
protected boolean preserveReposUponCompletion() {
39+
protected final boolean preserveReposUponCompletion() {
40+
return true;
41+
}
42+
43+
@Override
44+
protected boolean preserveTemplatesUponCompletion() {
45+
return true;
46+
}
47+
48+
@Override
49+
protected boolean preserveSnapshotsUponCompletion() {
4050
return true;
4151
}
4252

qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/XPackIT.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,11 @@ public void testIndexTemplatesCreated() throws Exception {
8787
expectedTemplates.add(".ml-meta");
8888
expectedTemplates.add(".ml-notifications");
8989
expectedTemplates.add(".ml-state");
90+
expectedTemplates.add(".monitoring-alerts");
91+
expectedTemplates.add(".monitoring-beats");
92+
expectedTemplates.add(".monitoring-es");
93+
expectedTemplates.add(".monitoring-kibana");
94+
expectedTemplates.add(".monitoring-logstash");
9095
expectedTemplates.add("logstash-index-template");
9196
expectedTemplates.add("security-index-template");
9297
expectedTemplates.add("security_audit_log");

0 commit comments

Comments
 (0)