Skip to content

Commit 8860a0b

Browse files
committed
Add a failing test
After migrating the system indices, the having .geoip_databases as an index-behind-an-alias ends up resulting in `GET _data_stream` blowing up.
1 parent 8e34393 commit 8860a0b

File tree

1 file changed

+20
-0
lines changed

1 file changed

+20
-0
lines changed

modules/ingest-geoip/qa/full-cluster-restart/src/javaRestTest/java/org/elasticsearch/ingest/geoip/FullClusterRestartIT.java

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,13 +123,19 @@ public void testGeoIpSystemFeaturesMigration() throws Exception {
123123

124124
// as should a normal get *
125125
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
126+
127+
// and getting data streams
128+
assertBusy(() -> testGetDatastreams());
126129
} else {
127130
// after the upgrade, but before the migration, Kibana should work
128131
assertBusy(() -> testGetStarAsKibana(List.of("my-index-00001"), maybeSecurityIndex));
129132

130133
// as should a normal get *
131134
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndex));
132135

136+
// and getting data streams
137+
assertBusy(() -> testGetDatastreams());
138+
133139
// migrate the system features and give the cluster a moment to settle
134140
Request migrateSystemFeatures = new Request("POST", "/_migration/system_features");
135141
assertOK(client().performRequest(migrateSystemFeatures));
@@ -144,6 +150,9 @@ public void testGeoIpSystemFeaturesMigration() throws Exception {
144150
// as should a normal get *
145151
assertBusy(() -> testGetStar(List.of("my-index-00001"), maybeSecurityIndexReindexed));
146152

153+
// and getting data streams
154+
assertBusy(() -> testGetDatastreams());
155+
147156
Request disableDownloader = new Request("PUT", "/_cluster/settings");
148157
disableDownloader.setJsonEntity("""
149158
{"persistent": {"ingest.geoip.downloader.enabled": false}}
@@ -257,4 +266,15 @@ private void testGetStarAsKibana(List<String> indexNames, @Nullable List<String>
257266
Map<String, Object> map = responseAsMap(response);
258267
assertThat(map.keySet(), is(new HashSet<>(indexNames)));
259268
}
269+
270+
private void testGetDatastreams() throws IOException {
271+
Request getStar = new Request("GET", "_data_stream");
272+
getStar.setOptions(
273+
RequestOptions.DEFAULT.toBuilder().setWarningsHandler(WarningsHandler.PERMISSIVE) // we don't care about warnings, just errors
274+
);
275+
Response response = client().performRequest(getStar);
276+
assertOK(response);
277+
278+
// note: we don't actually care about the response, just that there was one and that it didn't error out on us
279+
}
260280
}

0 commit comments

Comments
 (0)