Skip to content

Commit b9ff203

Browse files
Merge branch 'main' into sort_other_numeric_types
2 parents 452695b + fce28cc commit b9ff203

File tree

7 files changed

+817
-254
lines changed

7 files changed

+817
-254
lines changed

modules/data-streams/src/internalClusterTest/java/org/elasticsearch/datastreams/lifecycle/ExplainDataStreamLifecycleIT.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -486,7 +486,9 @@ public void testExplainLifecycleForIndicesWithErrors() throws Exception {
486486
* succeed, and there will always be an error in the error store. This behavior is subject to change in the future.
487487
*/
488488
assertThat(response.getIndices().get(0).getError(), is(notNullValue()));
489-
assertThat(response.getIndices().get(1).getError(), is(nullValue()));
489+
assertThat(response.getIndices().get(0).getError().error(), containsString("Force merge request "));
490+
assertThat(response.getIndices().get(1).getError(), is(notNullValue()));
491+
assertThat(response.getIndices().get(1).getError().error(), containsString("Force merge request "));
490492
}
491493
});
492494
}

muted-tests.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -387,9 +387,6 @@ tests:
387387
- class: org.elasticsearch.xpack.searchablesnapshots.SearchableSnapshotsIntegTests
388388
method: testCreateAndRestoreSearchableSnapshot
389389
issue: https://github.com/elastic/elasticsearch/issues/119709
390-
- class: org.elasticsearch.datastreams.lifecycle.ExplainDataStreamLifecycleIT
391-
method: testExplainLifecycleForIndicesWithErrors
392-
issue: https://github.com/elastic/elasticsearch/issues/126252
393390
- class: org.elasticsearch.xpack.test.rest.XPackRestIT
394391
method: test {p0=transform/transforms_stats/Test get transform stats}
395392
issue: https://github.com/elastic/elasticsearch/issues/126270
@@ -405,6 +402,9 @@ tests:
405402
- class: org.elasticsearch.packaging.test.DockerTests
406403
method: test023InstallPluginUsingConfigFile
407404
issue: https://github.com/elastic/elasticsearch/issues/126145
405+
- class: org.elasticsearch.search.SearchWithRejectionsIT
406+
method: testOpenContextsAfterRejections
407+
issue: https://github.com/elastic/elasticsearch/issues/126340
408408

409409
# Examples:
410410
#

server/src/main/java/org/elasticsearch/action/datastreams/autosharding/AutoShardingResult.java

Lines changed: 32 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99

1010
package org.elasticsearch.action.datastreams.autosharding;
1111

12-
import org.elasticsearch.core.Nullable;
12+
import org.elasticsearch.common.Strings;
1313
import org.elasticsearch.core.TimeValue;
1414

1515
import java.util.Arrays;
@@ -25,13 +25,7 @@
2525
* {@link DataStreamAutoShardingService#DATA_STREAMS_AUTO_SHARDING_EXCLUDES_SETTING}) the target number of shards will be -1 and cool down
2626
* remaining {@link TimeValue#MAX_VALUE}.
2727
*/
28-
public record AutoShardingResult(
29-
AutoShardingType type,
30-
int currentNumberOfShards,
31-
int targetNumberOfShards,
32-
TimeValue coolDownRemaining,
33-
@Nullable Double writeLoad
34-
) {
28+
public record AutoShardingResult(AutoShardingType type, int currentNumberOfShards, int targetNumberOfShards, TimeValue coolDownRemaining) {
3529

3630
static final String COOLDOWN_PREVENTING_TYPES = Arrays.toString(
3731
new AutoShardingType[] { COOLDOWN_PREVENTED_DECREASE, COOLDOWN_PREVENTED_INCREASE }
@@ -53,8 +47,36 @@ public record AutoShardingResult(
5347
AutoShardingType.NOT_APPLICABLE,
5448
-1,
5549
-1,
56-
TimeValue.MAX_VALUE,
57-
null
50+
TimeValue.MAX_VALUE
5851
);
5952

53+
@Override
54+
public String toString() {
55+
return switch (type) {
56+
case INCREASE_SHARDS -> Strings.format(
57+
"Recommendation to increase shards from %d to %d",
58+
currentNumberOfShards,
59+
targetNumberOfShards
60+
);
61+
case DECREASE_SHARDS -> Strings.format(
62+
"Recommendation to decrease shards from %d to %d",
63+
currentNumberOfShards,
64+
targetNumberOfShards
65+
);
66+
case COOLDOWN_PREVENTED_INCREASE -> Strings.format(
67+
"Deferred recommendation to increase shards from %d to %d after cooldown period %s",
68+
currentNumberOfShards,
69+
targetNumberOfShards,
70+
coolDownRemaining
71+
);
72+
case COOLDOWN_PREVENTED_DECREASE -> Strings.format(
73+
"Deferred recommendation to decrease shards from %d to %d after cooldown period %s",
74+
currentNumberOfShards,
75+
targetNumberOfShards,
76+
coolDownRemaining
77+
);
78+
case NO_CHANGE_REQUIRED -> Strings.format("Recommendation to leave shards unchanged at %d", currentNumberOfShards);
79+
case NOT_APPLICABLE -> "No recommendation as auto-sharding not enabled";
80+
};
81+
}
6082
}

0 commit comments

Comments
 (0)