Skip to content

Commit edd6326

Browse files
[ML] Remove scale to zero feature flag (#114323) (#114388)
Co-authored-by: Elastic Machine <[email protected]>
1 parent b0c78eb commit edd6326

File tree

5 files changed

+2
-29
lines changed

5 files changed

+2
-29
lines changed

test/test-clusters/src/main/java/org/elasticsearch/test/cluster/FeatureFlag.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ public enum FeatureFlag {
1919
TIME_SERIES_MODE("es.index_mode_feature_flag_registered=true", Version.fromString("8.0.0"), null),
2020
FAILURE_STORE_ENABLED("es.failure_store_feature_flag_enabled=true", Version.fromString("8.12.0"), null),
2121
CHUNKING_SETTINGS_ENABLED("es.inference_chunking_settings_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
22-
INFERENCE_SCALE_TO_ZERO("es.inference_scale_to_zero_feature_flag_enabled=true", Version.fromString("8.16.0"), null),
2322
INFERENCE_DEFAULT_ELSER("es.inference_default_elser_feature_flag_enabled=true", Version.fromString("8.16.0"), null);
2423

2524
public final String systemProperty;

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScaler.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -170,8 +170,7 @@ Integer scale() {
170170
if (maxNumberOfAllocations != null) {
171171
numberOfAllocations = Math.min(numberOfAllocations, maxNumberOfAllocations);
172172
}
173-
if (ScaleToZeroFeatureFlag.isEnabled()
174-
&& (minNumberOfAllocations == null || minNumberOfAllocations == 0)
173+
if ((minNumberOfAllocations == null || minNumberOfAllocations == 0)
175174
&& timeWithoutRequestsSeconds > SCALE_TO_ZERO_AFTER_NO_REQUESTS_TIME_SECONDS) {
176175
logger.debug("[{}] adaptive allocations scaler: scaling down to zero, because of no requests.", deploymentId);
177176
numberOfAllocations = 0;

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerService.java

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -421,8 +421,7 @@ private void processDeploymentStats(GetDeploymentStatsAction.Response statsRespo
421421
}
422422

423423
public boolean maybeStartAllocation(TrainedModelAssignment assignment) {
424-
if (ScaleToZeroFeatureFlag.isEnabled()
425-
&& assignment.getAdaptiveAllocationsSettings() != null
424+
if (assignment.getAdaptiveAllocationsSettings() != null
426425
&& assignment.getAdaptiveAllocationsSettings().getEnabled() == Boolean.TRUE) {
427426
lastScaleUpTimesMillis.put(assignment.getDeploymentId(), System.currentTimeMillis());
428427
updateNumberOfAllocations(assignment.getDeploymentId(), 1);

x-pack/plugin/ml/src/main/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/ScaleToZeroFeatureFlag.java

Lines changed: 0 additions & 20 deletions
This file was deleted.

x-pack/plugin/ml/src/test/java/org/elasticsearch/xpack/ml/inference/adaptiveallocations/AdaptiveAllocationsScalerTests.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -148,8 +148,6 @@ public void testAutoscaling_maxAllocationsSafeguard() {
148148
}
149149

150150
public void testAutoscaling_scaleDownToZeroAllocations() {
151-
assumeTrue("Should only run if adaptive allocations feature flag is enabled", ScaleToZeroFeatureFlag.isEnabled());
152-
153151
AdaptiveAllocationsScaler adaptiveAllocationsScaler = new AdaptiveAllocationsScaler("test-deployment", 1);
154152
// 1 hour with 1 request per 1 seconds, so don't scale.
155153
for (int i = 0; i < 3600; i++) {
@@ -180,8 +178,6 @@ public void testAutoscaling_scaleDownToZeroAllocations() {
180178
}
181179

182180
public void testAutoscaling_dontScaleDownToZeroAllocationsWhenMinAllocationsIsSet() {
183-
assumeTrue("Should only run if adaptive allocations feature flag is enabled", ScaleToZeroFeatureFlag.isEnabled());
184-
185181
AdaptiveAllocationsScaler adaptiveAllocationsScaler = new AdaptiveAllocationsScaler("test-deployment", 1);
186182
adaptiveAllocationsScaler.setMinMaxNumberOfAllocations(1, null);
187183

0 commit comments

Comments
 (0)