Skip to content

Commit

Permalink
QA: Preserve templates and snapshot on upgrades
Browse files Browse the repository at this point in the history
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
  • Loading branch information
nik9000 committed May 29, 2018
1 parent 386af5a commit 86364f8
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
2 changes: 1 addition & 1 deletion distribution/src/config/log4j2.properties
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ appender.rolling.strategy.action.condition.glob = ${sys:es.logs.cluster_name}-*
appender.rolling.strategy.action.condition.nested_condition.type = IfAccumulatedFileSize
appender.rolling.strategy.action.condition.nested_condition.exceeds = 2GB

rootLogger.level = info
rootLogger.level = debug
rootLogger.appenderRef.console.ref = console
rootLogger.appenderRef.rolling.ref = rolling

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,16 @@ protected final boolean preserveReposUponCompletion() {
return true;
}

@Override
protected boolean preserveTemplatesUponCompletion() {
return true;
}

@Override
protected boolean preserveSnapshotsUponCompletion() {
return true;
}

@Override
protected final Settings restClientSettings() {
return Settings.builder().put(super.restClientSettings())
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,22 @@
public class UpgradeClusterClientYamlTestSuiteIT extends ESClientYamlSuiteTestCase {

@Override
protected boolean preserveIndicesUponCompletion() {
protected final boolean preserveIndicesUponCompletion() {
return true;
}

@Override
protected boolean preserveReposUponCompletion() {
protected final boolean preserveReposUponCompletion() {
return true;
}

@Override
protected boolean preserveTemplatesUponCompletion() {
return true;
}

@Override
protected boolean preserveSnapshotsUponCompletion() {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,11 @@ public void testIndexTemplatesCreated() throws Exception {
expectedTemplates.add(".ml-meta");
expectedTemplates.add(".ml-notifications");
expectedTemplates.add(".ml-state");
expectedTemplates.add(".monitoring-alerts");
expectedTemplates.add(".monitoring-beats");
expectedTemplates.add(".monitoring-es");
expectedTemplates.add(".monitoring-kibana");
expectedTemplates.add(".monitoring-logstash");
expectedTemplates.add("logstash-index-template");
expectedTemplates.add("security-index-template");
expectedTemplates.add("security_audit_log");
Expand Down

0 comments on commit 86364f8

Please sign in to comment.