Preserve deployments with zero allocations during assignment planning#137244
Merged
jan-elastic merged 5 commits intoelastic:mainfrom Oct 31, 2025
Merged
Conversation
Collaborator
|
Pinging @elastic/ml-core (Team:ML) |
Collaborator
|
Hi @jan-elastic, I've created a changelog YAML for you. |
552761f to
b506b2e
Compare
DonalEvans
reviewed
Oct 28, 2025
...rc/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlanner.java
Outdated
Show resolved
Hide resolved
Contributor
jonathan-buttner
left a comment
There was a problem hiding this comment.
I did some manual testing and confirmed this works. I'll do some more testing tomorrow as well though 👍
valeriy42
approved these changes
Oct 29, 2025
Contributor
valeriy42
left a comment
There was a problem hiding this comment.
Great work on figuring out the bug! 🚀 You have my approve. ✅ I left a couple of non-essential comments and suggestions.
...l/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java
Show resolved
Hide resolved
|
|
||
| Map<Node, List<Tuple<Deployment, Integer>>> nodeToModel = new HashMap<>(); | ||
| for (Deployment m : assignments.keySet()) { | ||
| for (Node n : assignments.get(m).keySet()) { |
Contributor
There was a problem hiding this comment.
Suggested change
| for (Node n : assignments.get(m).keySet()) { // Note: zero-allocation deployments are not printed |
nit: zero-allocation deployments will have an empty map. So they won't be pretty-printed. Maybe either comment this nuance or extend prettyPrint() to handle zero-allocation deployments as well.
...l/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java
Outdated
Show resolved
Hide resolved
...st/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlannerTests.java
Show resolved
Hide resolved
...st/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlannerTests.java
Outdated
Show resolved
Hide resolved
...l/src/main/java/org/elasticsearch/xpack/ml/inference/assignment/planning/AssignmentPlan.java
Outdated
Show resolved
Hide resolved
b506b2e to
cbe6923
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #137134