Skip to content

Conversation

nicktindall
Copy link
Contributor

Use appropriate UnassignedInfo.Reason when failure count is 0 so as to not trip assertion in UnassignedInfo constructor.

Closes #135566

Use appropriate UnassignedInfo.Reason when failure count is 0
@nicktindall nicktindall added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Allocation All issues relating to the decision making around placing a shard (both master logic & on the nodes) labels Sep 29, 2025
@elasticsearchmachine elasticsearchmachine added Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0 labels Sep 29, 2025
@elasticsearchmachine
Copy link
Collaborator

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

if (randomBoolean()) {
failureCount = randomBoolean() ? 0 : 1;
reason = UnassignedInfo.Reason.ALLOCATION_FAILED;
reason = failureCount > 0 ? UnassignedInfo.Reason.ALLOCATION_FAILED : UnassignedInfo.Reason.NEW_INDEX_RESTORED;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I stole the reason from the value that appears in RestoreSnapshotIT#testExplainUnassigableDuringRestore, though I don't think the reason features anywhere in the decider logic so we could probably randomise it?

Copy link
Contributor

@schase-es schase-es left a comment

Choose a reason for hiding this comment

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

LGTM

…AllocationDeciderTest

# Conflicts:
#	muted-tests.yml
@nicktindall nicktindall enabled auto-merge (squash) October 1, 2025 01:49
@nicktindall nicktindall merged commit 219337d into elastic:main Oct 1, 2025
35 checks passed
@nicktindall nicktindall deleted the fix_RestoreInProgressAllocationDeciderTest branch October 1, 2025 03:14
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) Team:Distributed Coordination Meta label for Distributed Coordination team >test Issues or PRs that are addressing/adding tests v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] RestoreInProgressAllocationDeciderTests testCanAllocatePrimaryExistingInRestoreInProgress failing
3 participants