Skip to content

[CI] IndexingShardRelocationIT testPreferredNodeIdsAreUsedDuringRelocation failing #168942

Backlog

Description

@infra-vault-gh-plugin-prod

Build Scans:

Reproduction Line:

./gradlew ":x-pack:plugin:stateless:internalClusterTest" --tests "org.elasticsearch.xpack.stateless.recovery.IndexingShardRelocationIT.testPreferredNodeIdsAreUsedDuringRelocation" -Dtests.seed=8A2D3DE9CCB45DF3 -Dtests.locale=ne-Deva-NP -Dtests.timezone=America/St_Lucia -Druntime.java=21

Applicable branches:
9.5

Reproduces locally?:
N/A

Failure History:
See dashboard

Failure Message:

org.gradle.internal.exceptions.DefaultMultiCauseException: Multiple Failures (3 failures)
	java.lang.AssertionError: safeAwait: CountDownLatch did not reach zero within the timeout
	java.lang.AssertionError: timed out waiting for relocation
Expected: <false>
     but: was <true>
	com.carrotsearch.randomizedtesting.UncaughtExceptionError: Captured an uncaught exception in thread: Thread[id=1250, name=elasticsearch[node_t1][generic][T#2], state=RUNNABLE, group=TGRP-IndexingShardRelocationIT]

Issue Reasons:

  • [9.5] 1 consecutive failures in test testPreferredNodeIdsAreUsedDuringRelocation
  • [9.5] 1 consecutive failures in step openjdk21_checkpart2_java-matrix
  • [9.5] 1 consecutive failures in pipeline elasticsearch-periodic

Note:
This issue was created using new test triage automation. Please report issues or feedback to es-core-infra.

Activity

  1. added
    >test-failure
    :Distributed/Recovery
    on Dec 6, 2026
  2. added
    Team:Distributed
    needs:risk
    on Dec 6, 2026
  3. elasticsearchmachine commented on Dec 6, 2026

    @elasticsearchmachine
    Collaborator

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

  4. infra-vault-gh-plugin-prod commented on Dec 6, 2026

    @infra-vault-gh-plugin-prod
    ContributorAuthor

    This has been muted on branch 9.5

    Mute Reasons:

    • [9.5] 1 consecutive failures in test testPreferredNodeIdsAreUsedDuringRelocation
    • [9.5] 1 consecutive failures in step openjdk21_checkpart2_java-matrix
    • [9.5] 1 consecutive failures in pipeline elasticsearch-periodic

    Muted tasks:

    • :x-pack:plugin:stateless:internalClusterTest

    Build Scans:

  5. elasticsearchmachine commented on Dec 6, 2026

    @elasticsearchmachine
    Collaborator

    Test Failure Analysis

    Summary

    • Likely a timing/race flake in the test's relocation choreography (IndexingShardRelocationIT.testPreferredNodeIdsAreUsedDuringRelocation, x-pack stateless). The test blocks START_RELOCATION, refreshes, and then waits on several CountDownLatches (safeAwait). One timed out, followed by "timed out waiting for relocation" and an uncaught exception on node_t1[generic]. This is probably an assertion thrown inside a mock-transport handler, or a notification that never arrived.
    • Only one failure so far (9.5 periodic); I could not retrieve the full failure output, so the exact latch that stalled is unknown.

    Release risk: low-risk

    Test-only choreography with mock transport handlers. There's a single occurrence and it did not reproduce. It would go up if the uncaught exception turns out to be a production-path error, such as a wrong preferred node id or a failed chunk fetch during relocation.

    Impact

    Reproduction

    Mitigation Proposal

    • Reproduction verdict: the pass with the identical seed and commit fits a race or load-dependent flake. It lowers confidence in any specific mechanism.
    • Codebase investigation: the test installs request-handling behaviours on the search node and on both index nodes. It then awaits sourceNotificationReceived, sourceGetChunkRequestReceived and targetNotificationReceived. Assertions inside the handlers (assertThat(notification.getNodeId()...), term checks) run on transport threads. A failure there surfaces as the uncaught exception and leaves the latches un-counted, so the safeAwait times out. The failure message shows this cascade.
    • Recent git history: not examined in depth.
    • Proposed fix: fetch the first failure (the uncaught exception stack) from the scan or the test report to see which handler assertion fired. Then either fix the production behaviour (if the preferred node id is wrong in a legitimate interleaving), or harden the test. Hardening means recording handler assertion failures and surfacing them where the awaits happen, and not assuming that generation beforeGeneration notifications arrive in a fixed order. Validate with -Dtests.iters=100 on the seed and random seeds, then close the issue.
    • Effort estimate: small — the cause is local to one test, once the stack trace is known.
    • Confidence: 0.40 (medium) — only a single occurrence, no reproduction, and the uncaught exception detail was not available.

    Generated by test-analysis · archimedes v1.5.2 · agent-router/claude-sonnet-5-5

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    :Distributed/Recovery>test-failureTeam:Distributedneeds:risk

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions