Skip to content

Conversation

@DiannaHohensee
Copy link
Contributor

@DiannaHohensee DiannaHohensee commented Oct 24, 2025

There are a LOT of allocation status enums.
This name better represents the meaning,
as there are no successful enum values.

Relates ES-12833


Simple IntelliJ aided rename, but lots of files. Left a comment on the source point for the rename.

@DiannaHohensee DiannaHohensee self-assigned this Oct 24, 2025
@DiannaHohensee DiannaHohensee added >non-issue :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) Team:Distributed Coordination Meta label for Distributed Coordination team v9.3.0 labels Oct 24, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/es-distributed-coordination (Team:Distributed Coordination)

*
* Note, ordering of the enum is important, make sure to add new values
* at the end and handle version serialization properly.
*/
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here's the comment explaining that these are unsuccessful allocation attempts.

There are a LOT of allocation status enums.
This name better represents the meaning,
as there are no successful enum values.

Relates ES-12729
@DiannaHohensee DiannaHohensee force-pushed the 2025/10/24/ES-12729-refactor branch from 606133c to d21c5d1 Compare October 24, 2025 21:36
@elasticsearchmachine elasticsearchmachine added the serverless-linked Added by automation, don't add manually label Oct 24, 2025
* at the end and handle version serialization properly.
*/
public enum AllocationStatus implements Writeable {
public enum FailedAllocationStatus implements Writeable {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FailedAllocationStatus contradicts some of the variants: FETCHING_SHARD_DATA, DELAYED_ALLOCATION, NO_ATTEMPT, those are not failures. I don't find existing name hard to understand. For me more confusing having Reason and AllocationStatus as two different enums, where AllocationStatus is partially a reason why shard is un-assigned, while Reason is some context of assignment.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. My interpretation of the two fields is:

  1. Reason is why the shard becomes unassigned in the first place.
  2. AllocationStatus is why the shard remains unassigned after attempt to assign it. It can be NO_ATTEMPT if this has not happend yet.

Also, failed allocation has a different meaning, i.e. the shard failed after being allocated to a data node. The fields UnassignedInfo.failedAllocations, UnassignedInfo.failure and UnassignedInfo.failedNodeIds are used for this scenario.

Copy link
Contributor Author

@DiannaHohensee DiannaHohensee Oct 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh damn, I didn't even see UnassignedInfo#Reason 😵

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) >non-issue serverless-linked Added by automation, don't add manually Team:Distributed Coordination Meta label for Distributed Coordination team v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants