Skip to content

Conversation

@DaveCTurner
Copy link
Contributor

Since #76884 in InternalTestCluster#validateClusterFormed we wait for
a correctly-sized cluster state to be applied before entering the
assertBusy() loop to wait for the cluster state to be exactly right
everywhere. Today we do this by injecting a cluster state observer into
one of the nodes which waits for a cluster state containing a master and
the right number of nodes. With this commit we move to using the cluster
health API which can do the same thing.

By this point any extra nodes have stopped, but there might still be a
stale join request for one of those nodes in the master's queue. This
commit addresses this by also waiting for the master queue to be empty.

Closes #81830

Since elastic#76884 in `InternalTestCluster#validateClusterFormed` we wait for
a correctly-sized cluster state to be applied before entering the
`assertBusy()` loop to wait for the cluster state to be exactly right
everywhere. Today we do this by injecting a cluster state observer into
one of the nodes which waits for a cluster state containing a master and
the right number of nodes. With this commit we move to using the cluster
health API which can do the same thing.

By this point any extra nodes have stopped, but there might still be a
stale join request for one of those nodes in the master's queue. This
commit addresses this by also waiting for the master queue to be empty.

Closes elastic#81830
@DaveCTurner DaveCTurner added >test Issues or PRs that are addressing/adding tests :Core/Infra/Core Core issues without another label v8.2.0 v7.17.3 labels Mar 29, 2022
@elasticmachine elasticmachine added the Team:Core/Infra Meta label for core/infra team label Mar 29, 2022
@elasticmachine
Copy link
Collaborator

Pinging @elastic/es-core-infra (Team:Core/Infra)

Copy link
Contributor

@arteam arteam left a comment

Choose a reason for hiding this comment

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

LGTM! This is a very neat internal usage of the Cluster Health API!

Copy link
Contributor

@henningandersen henningandersen left a comment

Choose a reason for hiding this comment

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

LGTM.

@DaveCTurner DaveCTurner merged commit a24e291 into elastic:master May 6, 2022
@DaveCTurner DaveCTurner deleted the 2022-03-29-validateClusterFormed-await-empty-master-queue branch May 6, 2022 19:24
DaveCTurner added a commit that referenced this pull request May 6, 2022
Since #76884 in `InternalTestCluster#validateClusterFormed` we wait for
a correctly-sized cluster state to be applied before entering the
`assertBusy()` loop to wait for the cluster state to be exactly right
everywhere. Today we do this by injecting a cluster state observer into
one of the nodes which waits for a cluster state containing a master and
the right number of nodes. With this commit we move to using the cluster
health API which can do the same thing.

By this point any extra nodes have stopped, but there might still be a
stale join request for one of those nodes in the master's queue. This
commit addresses this by also waiting for the master queue to be empty.

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

Labels

:Core/Infra/Core Core issues without another label Team:Core/Infra Meta label for core/infra team >test Issues or PRs that are addressing/adding tests v7.17.3 v8.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] DanglingIndicesIT testDanglingIndexOverMultipleNodesCanBeDeleted failing

5 participants