From 78dd787106662bef45a0dc143527354e6dbb76d0 Mon Sep 17 00:00:00 2001 From: Jan Kuipers <148754765+jan-elastic@users.noreply.github.com> Date: Fri, 11 Oct 2024 10:40:20 +0200 Subject: [PATCH] Fix deployment_stats.state for target_allocation_count=0 (#114570) --- .../xpack/core/ml/inference/assignment/AllocationStatus.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java index 7ae558c16cd1e..9216fc89a810d 100644 --- a/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java +++ b/x-pack/plugin/core/src/main/java/org/elasticsearch/xpack/core/ml/inference/assignment/AllocationStatus.java @@ -81,7 +81,7 @@ public AllocationStatus(StreamInput in) throws IOException { } public State calculateState() { - if (allocationCount == 0) { + if (allocationCount == 0 && targetAllocationCount > 0) { return State.STARTING; } if (allocationCount < targetAllocationCount) {