Skip to content

Commit 03d2df3

Browse files
authored
Fixing DataStreamsUpgradeIT.testUpgradeDataStream when cluster major version is unchanged (#119786)
1 parent c158692 commit 03d2df3

File tree

2 files changed

+10
-9
lines changed

2 files changed

+10
-9
lines changed

muted-tests.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -247,9 +247,6 @@ tests:
247247
- class: org.elasticsearch.search.profile.dfs.DfsProfilerIT
248248
method: testProfileDfs
249249
issue: https://github.com/elastic/elasticsearch/issues/119711
250-
- class: org.elasticsearch.upgrades.DataStreamsUpgradeIT
251-
method: testUpgradeDataStream
252-
issue: https://github.com/elastic/elasticsearch/issues/119717
253250
- class: org.elasticsearch.xpack.esql.optimizer.LocalPhysicalPlanOptimizerTests
254251
method: testSingleMatchFunctionFilterPushdownWithStringValues {default}
255252
issue: https://github.com/elastic/elasticsearch/issues/119720

x-pack/qa/rolling-upgrade/src/test/java/org/elasticsearch/upgrades/DataStreamsUpgradeIT.java

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -281,18 +281,22 @@ private void upgradeDataStream(String dataStreamName, int numRolloversOnOldClust
281281
);
282282
assertOK(statusResponse);
283283
assertThat(statusResponseMap.get("complete"), equalTo(true));
284-
// The number of rollovers that will have happened when we call reindex:
285-
final int rolloversPerformedByReindex = explicitRolloverOnNewClusterCount == 0 ? 1 : 0;
286284
final int originalWriteIndex = 1;
287-
assertThat(
288-
statusResponseMap.get("total_indices_in_data_stream"),
289-
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount + rolloversPerformedByReindex)
290-
);
291285
if (isOriginalClusterSameMajorVersionAsCurrent()) {
286+
assertThat(
287+
statusResponseMap.get("total_indices_in_data_stream"),
288+
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount)
289+
);
292290
// If the original cluster was the same as this one, we don't want any indices reindexed:
293291
assertThat(statusResponseMap.get("total_indices_requiring_upgrade"), equalTo(0));
294292
assertThat(statusResponseMap.get("successes"), equalTo(0));
295293
} else {
294+
// The number of rollovers that will have happened when we call reindex:
295+
final int rolloversPerformedByReindex = explicitRolloverOnNewClusterCount == 0 ? 1 : 0;
296+
assertThat(
297+
statusResponseMap.get("total_indices_in_data_stream"),
298+
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount + rolloversPerformedByReindex)
299+
);
296300
/*
297301
* total_indices_requiring_upgrade is made up of: (the original write index) + numRolloversOnOldCluster. The number of
298302
* rollovers on the upgraded cluster is irrelevant since those will not be reindexed.

0 commit comments

Comments
 (0)