Skip to content

Commit e877304

Browse files
authored
Fixing DataStreamsUpgradeIT.testUpgradeDataStream when cluster major version is unchanged (#119786) (#119795)
* Fixing DataStreamsUpgradeIT.testUpgradeDataStream when cluster major version is unchanged (#119786) * Removed bad merge from muted-tests.yml
1 parent 9260bcf commit e877304

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

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
@@ -275,18 +275,22 @@ private void upgradeDataStream(String dataStreamName, int numRolloversOnOldClust
275275
);
276276
assertOK(statusResponse);
277277
assertThat(statusResponseMap.get("complete"), equalTo(true));
278-
// The number of rollovers that will have happened when we call reindex:
279-
final int rolloversPerformedByReindex = explicitRolloverOnNewClusterCount == 0 ? 1 : 0;
280278
final int originalWriteIndex = 1;
281-
assertThat(
282-
statusResponseMap.get("total_indices_in_data_stream"),
283-
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount + rolloversPerformedByReindex)
284-
);
285279
if (isOriginalClusterSameMajorVersionAsCurrent()) {
280+
assertThat(
281+
statusResponseMap.get("total_indices_in_data_stream"),
282+
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount)
283+
);
286284
// If the original cluster was the same as this one, we don't want any indices reindexed:
287285
assertThat(statusResponseMap.get("total_indices_requiring_upgrade"), equalTo(0));
288286
assertThat(statusResponseMap.get("successes"), equalTo(0));
289287
} else {
288+
// The number of rollovers that will have happened when we call reindex:
289+
final int rolloversPerformedByReindex = explicitRolloverOnNewClusterCount == 0 ? 1 : 0;
290+
assertThat(
291+
statusResponseMap.get("total_indices_in_data_stream"),
292+
equalTo(originalWriteIndex + numRolloversOnOldCluster + explicitRolloverOnNewClusterCount + rolloversPerformedByReindex)
293+
);
290294
/*
291295
* total_indices_requiring_upgrade is made up of: (the original write index) + numRolloversOnOldCluster. The number of
292296
* rollovers on the upgraded cluster is irrelevant since those will not be reindexed.

0 commit comments

Comments
 (0)