Skip to content

Conversation

JeremyDahlgren
Copy link
Contributor

@JeremyDahlgren JeremyDahlgren commented Sep 24, 2025

The clusterAdmin() call at the end of the test uses a random node, which may not have been part of the current election, and may still have an old cluster state, prior to the creation of the index in the test. The fix ensures we use an admin client for the master node at the end of the test when checking for the test index.

Resolves: #134748

@JeremyDahlgren JeremyDahlgren added >test Issues or PRs that are addressing/adding tests :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed Coordination Meta label for Distributed Coordination team v9.2.0 v9.1.5 labels Sep 24, 2025
The clusterAdmin() call at the end of the test uses a random node,
which may not have been part of the current election, and may still
have an old cluster state, prior to the creation of the index in the
test.  The fix ensures we use the admin client for the master node.

Resolves: elastic#134748
@JeremyDahlgren JeremyDahlgren force-pushed the fix-es-134748-testElectMasterWithLatestVersion branch from 221bbc2 to 712c2c6 Compare September 25, 2025 00:01
@JeremyDahlgren JeremyDahlgren marked this pull request as ready for review September 25, 2025 00:12
@elasticsearchmachine
Copy link
Collaborator

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

Copy link
Contributor

@joshua-adams-1 joshua-adams-1 left a comment

Choose a reason for hiding this comment

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

LGTM!

@JeremyDahlgren JeremyDahlgren added the auto-backport Automatically create backport pull requests when merged label Sep 25, 2025
@JeremyDahlgren JeremyDahlgren merged commit 119c682 into elastic:main Sep 25, 2025
33 of 34 checks passed
@elasticsearchmachine
Copy link
Collaborator

💔 Backport failed

Status Branch Result
9.1 Commit could not be cherrypicked due to conflicts

You can use sqren/backport to manually backport by running backport --upstream elastic/elasticsearch --pr 135396

@JeremyDahlgren
Copy link
Contributor Author

💚 All backports created successfully

Status Branch Result
9.1

Questions ?

Please refer to the Backport tool documentation

JeremyDahlgren added a commit to JeremyDahlgren/elasticsearch that referenced this pull request Sep 25, 2025
…35396)

The clusterAdmin() call at the end of the test uses a random node,
which may not have been part of the current election, and may still
have an old cluster state, prior to the creation of the index in the
test.  The fix ensures we use the admin client for the master node.

Resolves: elastic#134748
(cherry picked from commit 119c682)

# Conflicts:
#	muted-tests.yml
szybia added a commit to szybia/elasticsearch that referenced this pull request Sep 25, 2025
…-dls

* upstream/main: (100 commits)
  ES|QL: Add FUSE operator tests (elastic#135307)
  [D0CS] Revise connector setup steps in documentation (elastic#135426)
  Fix DiscoveryDisruptionIT.testElectMasterWithLatestVersion (elastic#135396)
  [DOCS] Marks the change point agg as GA (elastic#134898)
  Rework ShardSearchContextId to explain use of searcher id better (elastic#135233)
  [CI] Handle caching bwc dependencies more gracefully (elastic#135417)
  Mute org.elasticsearch.gradle.TestClustersPluginFuncTest override jdk usage via ES_JAVA_HOME for known jdk os incompatibilities elastic#135413
  [Build] update eclipse formatter used by spotless (elastic#135382)
  [Test] Fix typo in build tool tests (elastic#135405)
  Fixes testSnapshotShutdownProgressTracker (elastic#134926)
  Mute org.elasticsearch.upgrades.StandardToLogsDbIndexModeRollingUpgradeIT testLogsIndexing {upgradedNodes=1} elastic#135313
  OTLP: remove feature flag (elastic#135401)
  [Docs] Convert asciidoc lifecycle markers into Docs V3 syntax (elastic#135347)
  Mute org.elasticsearch.upgrades.QueryableBuiltInRolesUpgradeIT testBuiltInRolesSyncedOnClusterUpgrade elastic#135194
  Mute org.elasticsearch.upgrades.IndexingIT testIndexing elastic#135407
  Mute org.elasticsearch.upgrades.DataStreamsUpgradeIT testDataStreamValidationDoesNotBreakUpgrade elastic#135406
  [CI] Handle git snapshot BWC versions correctly when calculating jdk fallback (elastic#135399)
  [Build] Update checkstyle from 10.3 to 11.0.1 (elastic#135381)
  Mute org.elasticsearch.upgrades.TextRollingUpgradeIT testIndexing {upgradedNodes=2} elastic#135238
  Mute org.elasticsearch.upgrades.MatchOnlyTextRollingUpgradeIT testIndexing {upgradedNodes=2} elastic#135325
  ...
@JeremyDahlgren
Copy link
Contributor Author

Although this test wasn't muted on 9.1 I'm backporting to it since the modifications done in #129118 that included adding the awaitMasterNode() call was added on 9.1.

JeremyDahlgren added a commit that referenced this pull request Sep 26, 2025
…135435)

The clusterAdmin() call at the end of the test uses a random node,
which may not have been part of the current election, and may still
have an old cluster state, prior to the creation of the index in the
test.  The fix ensures we use the admin client for the master node.

Resolves: #134748
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-backport Automatically create backport pull requests when merged backport pending :Distributed Coordination/Cluster Coordination Cluster formation and cluster state publication, including cluster membership and fault detection. Team:Distributed Coordination Meta label for Distributed Coordination team >test Issues or PRs that are addressing/adding tests v9.1.5 v9.2.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] DiscoveryDisruptionIT testElectMasterWithLatestVersion failing
3 participants